对重叠多边形进行布尔运算的好方法
对向量几何(多边形和折线)(例如存储在 shapefile 中的类型)执行布尔运算(并集、相交、减法)的最佳开源库是什么?你喜欢用什么?
OGR 看起来可能有这种功能,尽管我在他们的文档中找不到特定的命令。 Shapely 确实做到了这一点,而且很容易理解。 PostGIS 似乎也有一些用于此目的的命令。
但肯定还有更多,但我很难找到它们。
我对上述任何一个库都没有太多经验,并且希望对这些或其他库有任何意见。
谢谢!
What is the best open source library for performing boolean operations (union, intersect, subtract) on vector geometry (polygons and polylines), such as the type stored in shapefiles? What do you like to use?
OGR looks like it probably has this capability, though I'm having trouble finding the particular commands in their documentation.
Shapely definitely does this, and is easy to understand.
PostGIS appears to also have some commands for this.
But there must be more, and I'm having trouble finding them.
I don't have much experience with any of the above libraries, and would appreciate any opinions on these or other libraries.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不认为 OGR 可以帮助你做到这一点,尽管如果你的数据位于通过 SQL 支持这些操作的空间数据库中,那么它可以帮助你 - 你可以传入几何操作查询,OGR 将从数据库接收结果以通常的方式。
查看 GEOS 库,我很确定它可以做到这一点,但我没有使用过它,所以我无法进一步回答 http://trac.osgeo.org/geos/
I don't think OGR can help you do this, though it sort of could if your data were in a spatial database that supported these operations via SQL - you could pass in the geomety-manipulating query and OGR would receive the result from the DB in the usual way.
Check out the GEOS library, I'm pretty sure it could do this, but I've not used it so I can't answer further http://trac.osgeo.org/geos/
只需一点修正:Shapely 不对 shapefile 进行操作,而是对单个或多部分几何对象进行操作。与 shapefile 读取器/写入器结合使用,它可以用在按文件进行二进制操作的程序中(例如,我有一个在空间上比较 http://sgillies.net/mush.html),但和你一样,我在专有软件之外还没有见过这种类型的东西就像 ArcMap 一样。
Just a little correction: Shapely doesn't operate on shapefiles, it operates on single or multipart geometric objects. In conjunction with a shapefile reader/writer it could be used in a program that does binary operations file-wise (for example, I have a service that spatially compares GeoRSS feeds at http://sgillies.net/mush.html), but like you, I haven't seen that type of thing outside of proprietary software like ArcMap.