[postgis-users] Multipolygons UNION

Kirill Zinov kirill.zinov at gmail.com
Fri Nov 16 04:20:45 PST 2007


Hello,

I’m newbie with PostGIS and would like to ask to point me to a right 
direction. I need to unite all of the multipolygons that have the same 
attribute and that are contiguous to each other. Actually I need to 
unite the sub-divisions like the States in the US and keep the islands 
apart from the mainland.

I tried this query but it fails:

INSERT INTO country (the_geom, na2)
SELECT astext(multi(geomunion(the_geom))) AS the_geom, na2 FROM polbnda 
GROUP BY na2;

Please advise how to do this.

Kirill




More information about the postgis-users mailing list