[postgis-users] Can you rebuild a multipolygon from rings?

Sandro Santilli strk at keybit.net
Fri Oct 21 00:17:03 PDT 2011

On Fri, Oct 21, 2011 at 01:33:43PM +0800, Ben Madin wrote:

> But rebuilding the multipolygons is not so simple (for me) - I need to re-aggregate the remaining rings into a geometry dump to reinsert into the other dumped polygons to rebuild the multipolygon.


> insert into phl (the_geom) select ((st_dump(the_geom))) from summ.ctybnda where year=2005 and ccode like 'PHL';


> insert into phl2 (the_geom) select st_dumprings(((the_geom).geom)) from phl where id = 2601;

You're stripping out the "path" component of output from st_dump
and st_dumprings. Those are the keys to your later rebuilding.


  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html

More information about the postgis-users mailing list