How can I draw all boundaries of cities in Pennsylvania State, USA
4 次查看(过去 30 天)
显示 更早的评论
I have draw a map for Pennsylvanya but I need to divide the map by cities. So, how can I do that? that what I did:
pennsylvania1 = shaperead('usastatelo',...
'UseGeoCoords', true,...
'Selector', {@(name)strcmpi('pennsylvania',name), 'Name'});
geoshow(pennsylvania1)
0 个评论
回答(1 个)
Rajesh Balagam
2017-9-19
You need to download USA city/county shape file data for this. You can find it (USA_adm_shp.zip) here.
After extracting the data you can plot Pennsylvania state data as shown below.
data = shaperead('USA_adm2.shp','UseGeoCoords',true,'Selector',{@(name)strcmpi('pennsylvania',name),'NAME_1'});
geoshow(data)
2 个评论
Rajesh Balagam
2017-9-29
This error is produced when MATLAB couldn't find the specified file.
You need to change the MATLAB present working directory path to the directory where downloaded files are placed (or) copy the USA_adm2.shp file to your working directory.
Execute the above command after this.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!