[postgis-devel] [PostGIS] #630: ST_COLLECT null treatment

PostGIS trac at osgeo.org
Tue Oct 19 10:20:35 PDT 2010


#630: ST_COLLECT null treatment
---------------------+------------------------------------------------------
 Reporter:  bitner   |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  medium   |   Milestone:  PostGIS 1.5.3
Component:  postgis  |     Version:  1.5.X        
 Keywords:           |  
---------------------+------------------------------------------------------
 ST_COLLECT behaves differently than I would expect it to behave if an
 array with a null value is passed in. Rather than either completely
 bailing on a null value or returning a collection without the null value
 either not included (which is what I would love to see :-) ) or containing
 an empty geometry it simply includes all values in the array until the
 null value is encountered.

 Tests:
 SELECT ASEWKT(ST_COLLECT(
         ARRAY[
                 makepoint(0,0),
                 makepoint(1,1),
                 makepoint(2,2)
         ]
 ));
 -- MULTIPOINT(0 0,1 1,2 2)
 SELECT ASEWKT(ST_COLLECT(
         ARRAY[
                 null,
                 makepoint(0,0),
                 makepoint(1,1),
                 makepoint(2,2)
         ]
 ));
 -- null
 SELECT ASEWKT(ST_COLLECT(
         ARRAY[
                 makepoint(0,0),
                 makepoint(1,1),
                 null
                 makepoint(2,2)
         ]
 ));
 -- MULTIPOINT(0 0,1 1)

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/630>
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