[postgis-tickets] [PostGIS] #4736: ST_NumGeometries is zero for GeometryCollection with empty parts

PostGIS trac at osgeo.org
Thu Jul 29 13:57:41 PDT 2021


#4736: ST_NumGeometries is zero for GeometryCollection with empty parts
-------------------------+---------------------------
  Reporter:  Mike Taves  |      Owner:  strk
      Type:  defect      |     Status:  assigned
  Priority:  medium      |  Milestone:  PostGIS 3.0.4
 Component:  postgis     |    Version:  2.4.x
Resolution:              |   Keywords:
-------------------------+---------------------------

Comment (by pramsey):

 This case suggests that (a) empties count, so numgeometries(point empty)
 == 1 and numgeometries(collection empty) == number_of_subelements.
 {{{
 postgis_reg=# select st_numgeometries('MULTIPOINT(0 0, EMPTY, 1 1)');
  st_numgeometries
 ------------------
                 3
 (1 row)

 postgis_reg=# select st_astext(st_geometryn('MULTIPOINT(0 0, EMPTY, 1 1)',
 2));
   st_astext
 -------------
  POINT EMPTY
 (1 row)
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4736#comment:7>
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-tickets mailing list