[postgis-users] Creating a boundary of an aggregate of buildings

Luca Bertoncello lucabert at lucabert.de
Mon Jan 18 01:26:10 PST 2021


Am 18.01.2021 10:21, schrieb Tomas Straupis:

Hi Tomas,

>   In order to do aggregation/dissolving, you can try using st_buffer
> on grouped (clustered) geometries.
>   Something like this:
> 
>   st_buffer(st_buffer(your_clustered_aggregated_geometry, 1000), -1000)
> 
>   Depending on details you can add an option to use quad_segs=1 to
> avoid having round corners when doing positive buffer.
>   Something like this:
> 
>   st_buffer(st_buffer(you_clustered_aggregated_geometry, 1000,
> 'quad_segs=1'), -1000, 'quad_segs=1')

Do you mean something like that?

       SELECT ST_Buffer(ST_Buffer(way, 1000'quad_segs=1'), -1000, 
'quad_segs=1')
       FROM
         (SELECT way, ST_ClusterDBSCAN(way, eps := 50, minpoints := 2) 
OVER () AS cid
          FROM planet_osm_polygon
          WHERE landuse IN ('residential', 'retail', 
'retail;residential')
         ) a

Thanks
Luca Bertoncello
(lucabert at lucabert.de)


More information about the postgis-users mailing list