[postgis-users] insert polygon in multipolygon field

David TECHER davidtecher at yahoo.fr
Tue May 4 10:09:28 PDT 2004


> 
> I want to insert a polygon (returned by
> enveloppe(geomunion(the_geom))) into
> a multipolygon column.  How to cast the polygon to a
> multipolygon ?
> 
> Thanks,

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>


	

	
		
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout ! 
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !Téléchargez Yahoo! Messenger sur http://fr.messenger.yahoo.com



More information about the postgis-users mailing list