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

Tomas Straupis tomasstraupis at gmail.com
Mon Jan 18 01:51:09 PST 2021


2021-01-18, pr, 11:26 Luca Bertoncello rašė:
> 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

  Have not tested your statement, but besides missing comma between
1000 and 'quad_segs=1' looks fine.
  I use such buffering for landuse (forest, water) aggregation for
different scales.
  There are other options like doing +50 -100 +50, or -50 +100 -50
buffer. Depending on which works better. One way is better at
eradicating small inner gaps, other method is better at removing small
external details.

P.S. There is also convex function, but in my experience buffers give
better result.

-- 
Tomas


More information about the postgis-users mailing list