[PostGIS] #5640: ST_Covers missed one of the pairs
PostGIS
trac at osgeo.org
Thu Dec 7 02:21:42 PST 2023
#5640: ST_Covers missed one of the pairs
---------------------+---------------------------
Reporter: Wenjing | Owner: pramsey
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 3.4.2
Component: postgis | Version: 3.4.x
Keywords: |
---------------------+---------------------------
Consider the following statements:
{{{
DROP TABLE IF EXISTS origin;
CREATE TABLE origin (id int, geom geometry, valid boolean, gRelate int);
INSERT INTO origin (id, geom) VALUES (1, ST_LineFromText('LINESTRING(75
15,55 43)',0));
INSERT INTO origin (id, geom) VALUES (2, ST_LineFromText('LINESTRING(75
15,55 43)',0));
INSERT INTO origin (id, geom) VALUES (3,
ST_GeomFromText('GEOMETRYCOLLECTION(MULTIPOLYGON EMPTY,LINESTRING(75 15,55
43))',0));
SELECT a1.id, a2.id FROM origin As a1 JOIN origin As a2
ON ST_Covers(a1.geom, a2.geom) WHERE a1.id <> a2.id;
-- actual {1,2; 2,1; 3,1; 3,2}; expected {1,2; 2,1; 3,1; 3,2; 1,3; 2,3}
}}}
The 1st geometry covers the 3rd one, because each point in 3st geometry
lies inside 1st one, according to the definition of ST_Covers
> Returns true if every point in Geometry/Geography B lies inside (i.e.
intersects the interior or boundary of) Geometry/Geography A.
and the following statement result:
{{{
SELECT ST_Covers(a1.geom, a2.geom) FROM origin As a1, origin As a2 WHERE
a1.id = 1 and a2.id = 3;
-- result{t}
}}}
However, PostGis missed the pairs of 1,3 and 2,3.
The version is the newest on
[GitHub](https://trac.osgeo.org/postgis/wiki/GitHub):
{{{
POSTGIS="3.5.0dev 3.4.0rc1-818-g6c2e935b6" [EXTENSION] PGSQL="170"
GEOS="3.13.0dev-CAPI-1.18.0" PROJ="8.2.1
NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org/
USER_WRITABLE_DIRECTORY=/tmp/proj DATABASE_PATH=/usr/
share/proj/proj.db" LIBXML="2.9.13"
}}}
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5640>
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