Unexpected result from wmline command

조회 수: 1 (최근 30일)
Nachiket Wadwankar
Nachiket Wadwankar 2021년 6월 2일
댓글: Nachiket Wadwankar 2021년 6월 6일
Hello,
I want to plot a line connecting latitude and longitudes on map using wmline command. When I use the command i get and extra straight line connecting the start and end co-ordinates. How to avoid that line?
Regards,
Nachiket

채택된 답변

Walter Roberson
Walter Roberson 2021년 6월 2일
That does not happen in my tests, such as
cities = shaperead('worldcities.shp', 'UseGeoCoords', true, ...
'Selector', ...
{@(v)(ismember(v, {'London', 'Paris', 'Berlin'})), 'Name'});
lat = [cities.Lat];
lon = [cities.Lon];
wmline(lat,lon)
That suggests that your first and last lat and lon are the same.
  댓글 수: 3
Walter Roberson
Walter Roberson 2021년 6월 2일
Duplicate coordinates.
I recommend plotting your latitude and longitude individually; you will see a big jump half way through.
>> [Longitude([1, end/2]),Latitude([1, end/2])]
ans =
-90.402756 40.9385799
-90.402756 40.9385799
Nachiket Wadwankar
Nachiket Wadwankar 2021년 6월 6일
Actually my data was incorrect.
@Walter Roberson Thank you for your response

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by