[postgis-tickets] [PostGIS] #5580: ST_3DIntersects fails when encouting a GEOMETRYCOLLECTION with an empty geometry

PostGIS trac at osgeo.org
Thu Oct 19 23:29:11 PDT 2023


#5580: ST_3DIntersects fails when encouting a GEOMETRYCOLLECTION with an empty
geometry
----------------------+---------------------------
  Reporter:  Wenjing  |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  high     |  Milestone:  PostGIS 3.4.1
 Component:  postgis  |    Version:  3.4.x
Resolution:           |   Keywords:
----------------------+---------------------------
Description changed by Wenjing:

Old description:

> Consider this query:
>
> {{{
> SELECT
> ST_Intersects(a1, a2)
> FROM ST_GeomFromText('GEOMETRYCOLLECTION(POINT EMPTY, POINT (0 0))') As
> a1
> , ST_GeomFromText('POINT (0 0)') As a2;
> --excepted{t}
> }}}
> When using the 2D Intersects function in this situation, the expected
> result is true because POINT(0 0) is the two geometries' intersection.
> PostGIS returns true.
>
> But consider its 3D version:
> {{{
> SELECT
> ST_3DIntersects(a1, a2)
> FROM ST_GeomFromText('GEOMETRYCOLLECTION Z (POINT Z EMPTY, POINT Z (0 0
> 0))') As a1
> , ST_GeomFromText('POINT Z (0 0 0)') As a2;
> --excepted{t}; actual{f}
> }}}
> POINT Z (0 0 0) is the two geometries' intersection. So the excepted
> result of 3DIntersects is true.
>
> But the 3DIntersects function doesn't consider they intersect only when
> inserting an empty geometry before this point.

New description:

 Consider this query:

 {{{
 SELECT
 ST_Intersects(a1, a2)
 FROM ST_GeomFromText('GEOMETRYCOLLECTION(POINT EMPTY, POINT (0 0))') As a1
 , ST_GeomFromText('POINT (0 0)') As a2;
 --expected{t}
 }}}
 When using the 2D Intersects function in this situation, the expected
 result is true because POINT(0 0) is the two geometries' intersection.
 PostGIS returns true.

 But consider its 3D version:
 {{{
 SELECT
 ST_3DIntersects(a1, a2)
 FROM ST_GeomFromText('GEOMETRYCOLLECTION Z (POINT Z EMPTY, POINT Z (0 0
 0))') As a1
 , ST_GeomFromText('POINT Z (0 0 0)') As a2;
 --expected{t}; actual{f}
 }}}
 POINT Z (0 0 0) is the two geometries' intersection. So the excepted
 result of 3DIntersects is true.

 But the 3DIntersects function doesn't consider they intersect only when
 inserting an empty geometry before this point.

--
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5580#comment:5>
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