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

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 2 Jun. 2021

0 Stimmen

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 Kommentare

Nachiket Wadwankar
Nachiket Wadwankar am 2 Jun. 2021
Attached is the mat file of my co-ordinates. As suggested I checked, my first and last lat-lon are different.
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 am 6 Jun. 2021
Actually my data was incorrect.
@Walter Roberson Thank you for your response

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Graphics Object Properties finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by