[postgis-users] Method to remove overlaps in a layer

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Thu Mar 15 09:56:38 PDT 2012


>  1. find out intersecting pairs into cache (id1,id2,geom1,geom2)  2. update cache
> set geom1 = st_difference(geom1, geom2)  3. update main set geom = c.geom1
> from cache where id1 = id

Hum... Life is never that easy.

That would work if one polygon would always overlap with only one polygon but if one polygon is overlapped by two polygons or more the same polygon as two differences associated with it in the second step and only the last one will remains in the last update...

Pierre



More information about the postgis-users mailing list