[GIS] Merge polygons in postgis

postgisunion

I have a hand-digitized coverage stored in postgis. There, I have a few shiver-polygons I would like to get rid of by including them into one of the neighbouring polygons.

are there any commands that can be used to do that?

Something like

update coverage set the_geom=st_union(…) …

Of cource, I want to use the attributes from the large polygon – I must be able t decide which way the union goes.

Best Answer

SQL:

UPDATE coverage SET the_geom = ST_Union(
(SELECT the_geom FROM coverage WHERE id = :polygon_id),
(SELECT the_geom FROM coverage WHERE id = :sliver_id)
)
WHERE id = :polygon_id;

Is that what You meant?