[postgis-users] insert polygon in multipolygon field

Martel, Christian Christian.Martel at drdc-rddc.gc.ca
Tue May 4 13:01:08 PDT 2004


Thanks !
It works with a small correction in your query.
The second replace arguments are '))',')))' instead of ')','))'

Christian


> perhaps you could try this
> 
> select  geometryfromtext(replace(
> 			replace(
> 				astext(
> 					envelope(
> 							
> geomunion(the_geom)
> 						 )
> 					)
> 				  ,'POLYGON(','MULTIPOLYGON(('
> 				),')','))'),(select distinct 
> srid(the_geom) from
> <yourtablename>))
> 		 from <yourtablename>



More information about the postgis-users mailing list