How to add plot points in my map?

5 ビュー (過去 30 日間)
desert_scientist90
desert_scientist90 2019 年 12 月 15 日
編集済み: Adam Danz 2019 年 12 月 15 日
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);

採用された回答

Adam Danz
Adam Danz 2019 年 12 月 15 日
編集済み: Adam Danz 2019 年 12 月 15 日
"...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 件)

カテゴリ

Help Center および File ExchangeMapping Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by