Borrar filtros
Borrar filtros

How to add plot points in my map?

17 visualizaciones (últimos 30 días)
desert_scientist90
desert_scientist90 el 15 de Dic. de 2019
Editada: Adam Danz el 15 de Dic. de 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);

Respuesta aceptada

Adam Danz
Adam Danz el 15 de Dic. de 2019
Editada: Adam Danz el 15 de Dic. de 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')

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by