필터 지우기
필터 지우기

Symbolspec Lines with geoshow

조회 수: 7 (최근 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

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 C Shared Library Integration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by