Nilesh Gajwani created SEDONA-305:
-------------------------------------
Summary: Disallow creation of geometry collections consisting of
geometries of different dimensions.
Key: SEDONA-305
URL: https://issues.apache.org/jira/browse/SEDONA-305
Project: Apache Sedona
Issue Type: Bug
Reporter: Nilesh Gajwani
Currently, in sedona, it is possible to create a
GEOMETRYCOLLECTION/MULTI(POINT/POLYGON) with underlying geometries having
different dimensions.
For example, it is possible to create a MULTIPOLYGON with a 2D polygon and a 3D
polygon.
Due to this, checking the first coordinate to establish if the geometry is 3D
or not becomes invalid, and needs to be handled properly in individual APIs.
This has introduced a bug in ST_GeometricMedian, which assumes the geometry to
be 2D if the first coordinate is 2D. If a geometry collection with a 2D polygon
followed by a 3D polygon is provided to GeometricMedian, it will normalized 3D
coordinates of the 2nd Polygon to 0.
PostGIS does not support creation of such 'hybrid dimension' collections, by
disallowing this in the constructor, which seems like what should be done for
Sedona too.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)