How to add plot points in my map?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
desert_scientist90
le 15 Déc 2019
Modifié(e) : Adam Danz
le 15 Déc 2019
Hi all I am trying learn how to do a map with the air stations located on Pima county. I have the county already my question is how can I add the latitude and longitude of each station on my code? For example one of them is 32.52701484484009 -111.07177734375
Thanks in advance for your help
data = shaperead('tl_2019_us_county.shp','UseGeoCoords',true,'Selector',{@(name)strcmpi('pima',name),'NAME'});
geoshow(data);
0 commentaires
Réponse acceptée
Adam Danz
le 15 Déc 2019
Modifié(e) : Adam Danz
le 15 Déc 2019
"...how can I add the latitude and longitude of each station on my code"
Since you are using the shaperead argument pair {'UseGeoCoords',true},
data = shaperead('tl_2019_us_county.shp','UseGeoCoords',true, . . .);
data will be a structure array including fields lon and lat. To add additional latitude and longitude coordinates,
S(end+1).Lon = 32.52701484484009; % adds an additional structure to array
S(end).Lat = -111.07177734375; % adds the lat value to the new structure
% Add any other values to the new structure...
If the goal is to add those coordinates to the map, you can do that without altering the shaperead data.
geoshow(data);
hold on
plot(-111.07177734375, 32.52701484484009,'bo')
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Mapping Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!