MATLAB Answers

Unexpected result from wmline command

2 views (last 30 days)
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

Accepted Answer

Walter Roberson
Walter Roberson on 2 Jun 2021
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 Comments
Nachiket Wadwankar
Nachiket Wadwankar on 6 Jun 2021
Actually my data was incorrect.
@Walter Roberson Thank you for your response

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!