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

Tomas Straupis tomasstraupis at gmail.com
Mon Jan 18 04:55:50 PST 2021


2021-01-18, pr, 14:35 Luca Bertoncello rašė:
> So, if I undestand correctly I create a new table city_boundaries with
> all buildings of the given types in a radius of 10 meters, is if
> correct?

  Yes (just not buildings, but landuses).
  ST_ClusterWithin(way, 500)) <- this combines all polygons which are
less than 500 meters apart.
  For landuses 10 meters for ST_Buffer not enough. Try increasing 10
to say a 400(m) or even more (especially given you're clustering
polygons with a distance of 500 meters). If a distance between
different parts (polygons) of a geometry is 500 meters, you need a
buffer of at least 250 meters for them to "touch", if different parts
of geometries will not "touch" with positive buffer - they will not
combine - will not form one aggregated geometry out of a lot of small
ones.

> But I don't understand what "res" means...

  In my case the same table holds information for different scales of
a map (multi-sclae). res=10 are values for 10 scale, then there are
values for 40, 120 etc. You can ignore them.

P.S. Hint: do one step at a time and then use QGIS to see how those
intermediate geometries look like. It will make it easier to
understand what this code does.

-- 
Tomas


More information about the postgis-users mailing list