How can I form polygons from lines

隐身守侯 提交于 2019-12-08 05:13:13

问题


I have a bunch of 2-dimensional lines, whose start and end points are known. The lines might occasionally cross each other, or one line might end in the middle of another line. I need to form polygons from this mesh of lines. If necessary, I can ensure that the left side of all lines are inside their polygons.


回答1:


What you're describing is what we called "parcelization" or "spaghetti cutting", and then "polygonization" when I worked for GeoVision. Basically you want to cut the lines where-ever they intersect other lines and themselves, and then you want to assemble them into polygons by traversing line/node/line until you find a closed polygon.



来源:https://stackoverflow.com/questions/375471/how-can-i-form-polygons-from-lines

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!