[postgis-devel] [PostGIS] #534: Provide function to add new geometries to a collection

PostGIS trac at osgeo.org
Thu May 27 07:24:01 PDT 2010


#534: Provide function to add new geometries to a collection
---------------------------+------------------------------------------------
  Reporter:  jchamberlain  |       Owner:  robe         
      Type:  enhancement   |      Status:  assigned     
  Priority:  medium        |   Milestone:  PostGIS 1.5.2
 Component:  postgis       |     Version:  1.5.X        
Resolution:                |    Keywords:               
---------------------------+------------------------------------------------
Comment (by jchamberlain):

 I'll give this a shot and see how it works out. Thx

 Replying to [comment:2 robe]:
 > One problem with ST_Collect is if you are adding a point to a
 multipoint, you would end up with a geometry collection.
 >
 > You would probably want to combine with ST_CollectionExtract
 >
 http://www.postgis.org/documentation/manual-1.5/ST_CollectionExtract.html
 >
 >
 > {{{
 > -- adding a point to a multipoint
 > SELECT
 ST_AsText(ST_CollectionExtract(ST_Collect(ST_GeomFromText('MULTIPOINT(1 2,
 3 4)'), ST_GeomFromText('POINT(5 5)')),1));
 > }}}
 >
 >
 > {{{
 > -- adding an array of points to a multipoint
 > SELECT
 ST_AsText(ST_CollectionExtract(ST_Collect(ARRAY[ST_GeomFromText('MULTIPOINT(1
 2, 3 4)'), ST_GeomFromText('POINT(5 5)'), ST_GeomFromText('POINT(0 0 )')]
 ),1));
 > }}}
 >

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/534#comment:5>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list