Problem in reading .shp file
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
I have a problem in reading .shp file.
My .shp file contains all the major cities in Australia.
I want to read all the major cities located in the state of Queensland only.
I've tried to write code
shapedir = fullfile (pwd, 'Shapefile');
main_cities = shaperead (fullfile (shapedir, 'MainCities.shp'), 'usegeocoords', true);
But after this, I do not know how to do it.
When I opened the variable in the variable editor, I find a field named 'state', containing the name of different states in each struct.
Can someone help me? thank you
0 件のコメント
採用された回答
Chandra Kurniawan
2012 年 1 月 9 日
Hi, Raymond
You can perform that by adjusting the selector parameter.
I'll give you sample code :
shapedir = fullfile(pwd,'Shapefile');
main_cities = shaperead(fullfile(shapedir,'MainCities.shp'), ...
'usegeocoords',true,'selector', ...
{@(name) strcmp(name,'Queensland'),'state'});
3 件のコメント
Chandra Kurniawan
2012 年 1 月 9 日
Then you need to create the 'symbolspec'
Eq :
cities_spec = makesymbolspec('point',{'default','marker','o',...
'markeredgecolor','r',...
'markerfacecolor','b'});
Then form mapviewer, you can set the symbolspec from 'layer' menu.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!