How to crop a shapefile with a polyon?
5 次查看(过去 30 天)
显示 更早的评论
Is it possible to crop a shapefile with a polygon (potentially a circle) using Matlab. I have the coordinates of buildings in a shapefile (and in xlsx file as well), and would like to extract the buildings within a given circle. Is that possible with Matlab?
0 个评论
回答(1 个)
KSSV
2018-5-8
Read about inpolyon.
S = shaperead('my shape file') ;
S = [[S(:).X]' [S(:).Y]'] ;
idx = inpolygon(S(:,1),S(:,2),xc,yc) ; % where xc, yc are your circle coordinates
2 个评论
KSSV
2018-5-9
You should be knowing this......you said you have a polygon....any ways...to describe a circle..you need a radius r and center c. YOu decide it where you want a circle with what radius. Any more doubts?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 3-D Scene Control 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!