[postgis-tickets] [PostGIS] #5580: ST_3DIntersects fails when encouting a GEOMETRYCOLLECTION with an empty geometry
PostGIS
trac at osgeo.org
Fri Oct 20 04:24:16 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_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}
> }}}
> Postgis produces a result of false, but I expected it to produce true. I
> think this is a bug, due to the following 3 reasons:
>
> 1. ST_3DIntersection(a1, a2) returns POINT Z (0 0 0). So the expected
> result of 3DIntersects is true.
>
> 2. Considering the 2D version function, ST_Intersects(a1, a2) returns
> true here:
> {{{
> 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}
> }}}
>
> 3. Making the empty point position behind POINT Z (0 0 0),
> ST_3DIntersection(a1, a2) returns true.
New description:
Consider this query:
{{{
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}
}}}
Postgis produces a result of false, but I expected it to produce true. I
think this is a bug, due to the following 3 reasons:
1. ST_3DIntersection(a1, a2) returns POINT Z (0 0 0). So the expected
result of 3DIntersects is true.
2. Considering the 2D version function, ST_Intersects(a1, a2) returns true
here:
{{{
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}
}}}
3. Making the empty point position behind POINT Z (0 0 0),
ST_3DIntersection(a1, a2) returns true.
Version: POSTGIS="3.4.0 0874ea3" [EXTENSION] PGSQL="150"
GEOS="3.9.0-CAPI-1.16.2" SFCGAL="1.3.8" 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"
LIBPR
OTOBUF="1.3.3" WAGYU="0.5.0 (Internal)" TOPOLOGY
--
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5580#comment:8>
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