Symbolspec Lines with geoshow

11 ビュー (過去 30 日間)
Philipp Henschel
Philipp Henschel 2018 年 2 月 8 日
コメント済み: Philipp Henschel 2018 年 3 月 2 日
Hey,
I'm plotting latitude and longitude data to receive the flight routes. Now I want to color the routes/lines by airline(callsign), so I can see which airline is flying where. Therefore I'm using SymbolSpec. Besides the latitudedegrees and longitudedegree is a column in the table (LnL_Po1) with their callsign, shortened to the airline code.
LineColor = makesymbolspec('Line',{'callsign','UAL', 'Color',[11/256 84/256 229/256]},{'callsign', 'AAL', 'Color', [224/256 6/256 6/256]},{'callsign','DAL','Color',[196/256 0/256 107/256]},{'Default','Color','k'});
geoshow(LnL_Po1.latitudedegrees, LnL_Po1.longitudedegrees,'Line', 'SymbolSpec', LineColor);
Using this code I received following Error Message: The parameter/value inputs must be pairs. I tried to fix it by myself, but couldn't find a solution. Any Suggestions what could be wrong? Thanks in advance!
  2 件のコメント
Jyotish Robin
Jyotish Robin 2018 年 2 月 27 日
In the geoshow command, I don't see a name corresponding to the value 'Line'. You may be probably missing the name 'DisplayType' which needs to be used along with the value 'Line'.
Philipp Henschel
Philipp Henschel 2018 年 2 月 27 日
Thanks for your respond.
I tried what you recommended, still received another error message:
Error using line There is no SymbolSpec property on the Line class.
Error in mapline (line 23) h = line(xdata(:), ydata(:), 'Color', [0 0 1], varargin{:});
Error in geovec (line 21) h = fcn(x, y, varargin{:});
Error in geovecshow (line 67) h = geovec(mstruct, lat, lon, ...
Error in geoshow (line 276) h = showFcn(varargin{:});
I'm confused by the first line of the Error Message (-isn't this feature exactly for Lines etc.?!-) Any further ideas?

サインインしてコメントする。

回答 (1 件)

Jyotish Robin
Jyotish Robin 2018 年 3 月 1 日
Hi Philipp,
The geoshow(lat,lon,...) syntax doesn’t work with symbol specs – so geoshow simply passes the SymbolSpec name-value pair to line, which doesn’t know what do so with it.
In order to use a symbol spec, replace lat, lon with S, where S is a geopoint vector, a geoshape vector, or a geostruct (with 'Lat' and 'Lon' coordinate fields).
You can find more info about the stucture of S at https://www.mathworks.com/help/map/ref/geoshow.html
Hope this helps!
Thanks,
Jyotish
  1 件のコメント
Philipp Henschel
Philipp Henschel 2018 年 3 月 2 日
Hi Jyotish,
Yes it helps a bit. I see the problem with geoshow(lat, lon). I checked the documentation about the geopoint/geoshape vector and get the sense.
I now have the issue since I want to show multiple flight tracks, I have to seperate the lat&lon data points by their Flight ID and create an geostruct for every Flight ID, correct? But I have no idea how to get it done. Do you have any suggestions on the separation of the data?
Would be terrific if you can help me on this as well.
Thanks,
Philipp

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by