【问题标题】:How to fill in gaps between polygons using postgis functions如何使用 postgis 函数填充多边形之间的间隙
【发布时间】:2020-11-30 13:08:30
【问题描述】:

我有一个类似的情况,如下面的问题所示。

https://gis.stackexchange.com/questions/293695/filling-gaps-between-polygons-using-qgis

该解决方案使用 qgis,但我想在几何列的表上使用 postgis 函数。该解决方案讨论了凸包,但不确定如何在此处使用凸包 postgis 函数。我想通过将间隙移动/合并到相邻多边形来填补间隙。

【问题讨论】:

    标签: postgresql postgis


    【解决方案1】:

    只要您有一列将它们分组(例如,“postal_code”),您就可以:

    SELECT
        st_convexhull(st_collect(geom_column))
    FROM
        my_geom_table
    GROUP BY
        grouping_column -- e.g., "postal_code"
    

    【讨论】: