[postgis-tickets] [PostGIS] #4127: ST_Dimension returns 0 for empty GeometryCollection
PostGIS
trac at osgeo.org
Tue Jul 17 13:28:53 PDT 2018
#4127: ST_Dimension returns 0 for empty GeometryCollection
----------------------+---------------------------
Reporter: esparano | Owner: pramsey
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 2.4.5
Component: postgis | Version: 2.4.x
Keywords: |
----------------------+---------------------------
The documentation says that ST_Dimension should return 0 for Points and
NULL for empty geometries. However, there appears to be a bug in the code
where ST_Dimension return 0 for empty collections.
I would suggest changing line 1033 of lwgeom.c from:
{{{
int maxdim = 0, i;
}}}
to:
{{{
int maxdim = -1, i;
}}}
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4127>
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