GIS:将多个多边形转换为多个要素
我参与了一个 GIS 项目。我有一个底图文件(形状文件),其中包含城镇大部分地区的道路图层。问题在于形状文件仅包含两个特征,每个特征各包含大约 500000 个点。这些要素是内部包含大量多边形的多边形。我希望将其转换为众多特征,每个特征包含不超过一个多边形。是否可以?如果是,怎么办?
I am involved in a GIS project. I have a base map file (shape file) that contains the road layer for a large portion of a town. The problem is that the shape file contains only two features each containing around 500000 points each. The features are multipolygons containing a large no of polygons inside. I wish to convert it to numerous features each containing not more than one polygon. Is it possible? If yes, how?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来你这里拥有的是一个多部分功能。如果您使用的是 ArcGIS,则需要在 arcmap 中添加高级编辑器工具栏。启动编辑会话并使用分解多部分特征工具,然后您将为每条记录拥有一个几何图形。
Seems like what you have here is a multi-part feature. If you are using ArcGIS, you need to add the advance editor toolbar in your arcmap. Start an editing session and use the explode multi-part feature tool and then you will have one geometry for each record.
如果您有连通性信息(例如,您有多边形而不仅仅是点),那么做好多边形缩减工作并不是太难。
我过去所做的事情包括两个步骤。
任何被多边形包围的顶点(所有多边形都是共面的)都可以被删除。我通过将顶点“滑动”到邻居顶点来完成此操作,该邻居获取所有测试顶点的邻居,并且删除任何退化的三角形(例如,两个顶点之间共享的任何三角形)。
任何具有两条彼此相对的边的顶点,其中任一侧的多边形要么完全不存在,要么共面,也可以类似地折叠成相邻顶点,但显然只有沿着其中一条平行边的顶点。任何
注意-
如果两个多边形至少有一个公共点并且具有相同的法线,则它们是共面的。由于候选多边形始终附加到候选顶点,因此您只需比较多边形法线即可。法线可以通过多边形两条边的叉积来计算。
If you have connectivity information (e.g. you have polygons and not just points) it's not too tough to do a decent job of polygon reduction.
What I've done in the past consisted of two steps.
Any vertex that is surrounded by polygons, all of which are coplanar, can be removed. I did this by "sliding" the vertex to a neighbor vertex, that neighbor getting all of the test vertex's neighbors and any triangles that become degenerate (e.g. any triangles shared between the two vertices) were removed.
Any vertex which has two edges leaving opposite one another, where the polygons on either side are either completely nonexistent or are coplanar can also be similarly collapsed into a neighbor vertex, but obviously only one that is along one of the parallel edges.
note-
Two polygons are coplanar if they share at least one point in common and if they have the same normal. Since the candidate polygons are always attached to the candidate vertex, you just need to compare polygon normals. The normal can be computed by taking the cross product of two of the edges of the polygon.