How to add plot points in my map?
조회 수: 5 (최근 30일)
이전 댓글 표시
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
채택된 답변
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Mapping Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!