ST_BuildArea和ST_Polygonize有什么区别?


9

这两个函数ST_BuildAreaST_Polygonize两个卷绕线和产生多边形。

似乎ST_BuildArea假设内圈代表孔并从结果中忽略孔,而将孔ST_Polygonize包括在结果中。而且使用这些功能的机制有些不同:ST_Polygonize是一个汇总,同时ST_BuildArea需要您使用自己捆绑输入ST_Collect

除此之外,这两个功能之间是否有区别?


3
也许这些演示文稿幻灯片可能会有所帮助:http
Joseph

Answers:


1

这不是一个完整的答案,但可能是寻找更多详细信息的人的起点。

ST_Polygonize(以的形式polygonize_garray),并ST_BuildAreahttps://github.com/postgis/postgis/blob/svn-trunk/postgis/lwgeom_geos.c的源代码(镜像)中定义。

他们最终都调用了GEOSPolygonize,这是在GEOS中定义的,GEOSJava拓扑套件的C / C ++端口。

而从文档中-

ST_Polygonize-创建一个GeometryCollection,其中包含可能的多边形,这些多边形是由一组几何的构成线形成的。https://postgis.net/docs/ST_Polygonize.html

ST_BuildArea-创建由给定几何图形的组成线条形成的面几何图形。返回类型可以是Polygon或MultiPolygon,具体取决于输入。如果输入线稿未形成多边形,则返回NULL。输入可以是LINESTRINGS,MULTILINESTRINGS,POLYGONS,MULTIPOLYGONS和GeometryCollections。此功能将假定所有内部几何图形都表示孔。http://postgis.net/docs/ST_BuildArea.html

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.