[postgis-tickets] [PostGIS] #5572: ST_Difference drops z-dimension on empty result

PostGIS trac at osgeo.org
Tue Oct 17 03:22:07 PDT 2023


#5572: ST_Difference drops z-dimension on empty result
---------------------+---------------------------
 Reporter:  lkajan   |      Owner:  pramsey
     Type:  defect   |     Status:  new
 Priority:  medium   |  Milestone:  PostGIS 3.4.1
Component:  postgis  |    Version:  3.4.x
 Keywords:           |
---------------------+---------------------------
 When calling ST_Difference with two 3D geometries the result may be a 2D
 geometry in case when geometries are equal and result is an EMPTY
 geometry.

 **Expected behavior:**\\
 As the documentation states: "This function supports 3d and will not drop
 the z-index."

 **To reproduce:**\\
 {{{
 SELECT ST_AsText(ST_Difference('LINESTRINGZ(0 0 0,1 0 0)'::geometry,
 'LINESTRINGZ(0 0 0,1 0 0)'::geometry));
     st_astext
 ------------------
  LINESTRING EMPTY
 (1 row)
 }}}
 The result is a `LINESTRING EMPTY` and not a `LINESTRINGZ EMPTY` as one
 would expect.

 **PostGIS version:**\\
 POSTGIS="3.4.0 0874ea3" [EXTENSION] PGSQL="160" GEOS="3.9.0-CAPI-1.16.2"
 PROJ="7.2.1 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org
 USER_WRITABLE_DIRECTORY=/var/lib/postgresql/.local/share/proj
 DATABASE_PATH=/usr/share/proj/proj.db" LIBXML="2.9.10" LIBJSON="0.15"
 LIBPROTOBUF="1.3.3" WAGYU="0.5.0 (Internal)" TOPOLOGY
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5572>
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