Extract Lat/lon from Shapefiles
Ältere Kommentare anzeigen
I have a grid projected in a Cartesian coordinate where each point represents a portion of a terrain. And I'd like to know the distance between each of these points to the closest road.
These roads are in a shapefile, and the function I'm using ipdm needs a XY input (as my grid point in Cartesian coordinates). So, my thinking is somehow extract the lat/lon of the roads, convert to a projected coordinate, ad then use the ipdm .
Any thoughts?
Antworten (1)
Chad Greene
am 18 Jun. 2015
0 Stimmen
You should be able to use shaperead with the 'UseGeoCoords',false option to get roads in cartesian coordinates. Just make sure the projection associated with the shapefile is the same projection you're using for your data.
3 Kommentare
Igor Noberto
am 23 Jun. 2015
Chad Greene
am 24 Jun. 2015
I assume the road coordinates are in a structure array, so I wouldn't expect scatter(roads.X,roads.Y) to plot all the roads. What happens if you do
[X,Y] = polyjoin(roads.X,roads.Y);
plot(X,Y)
Igor Noberto
am 29 Jun. 2015
Bearbeitet: Igor Noberto
am 29 Jun. 2015
Kategorien
Mehr zu Map Display finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

