Skip to content

Latest commit

 

History

History
21 lines (19 loc) · 1.37 KB

32.md

File metadata and controls

21 lines (19 loc) · 1.37 KB

Consider the following statements:

DROP table t;
CREATE table t (id int, geom geometry);
INSERT INTO t (id, geom) VALUES (1,ST_GeomFromText('GEOMETRYCOLLECTION(MULTIPOINT((-60 -50),(-63 -49)))'));
INSERT INTO t (id, geom) VALUES (2,ST_GeomFromText('GEOMETRYCOLLECTION(MULTIPOINT((-60 -50),(-63 -49)))'));
INSERT INTO t (id, geom) VALUES (3,ST_GeomFromText('MULTIPOLYGON(((-60 -50,-70 -50,-60 -40,-60 -50)))'));
SELECT a1.id, a2.id FROM t As a1, t As a2 WHERE ST_Contains(a1.geom, a2.geom) and a1.id <> a2.id;
-- actual{1,2; 2,1; 3,1 }
-- expected{1,2; 2,1; 3,1; 3,2 }

It is noticed that the first geometry and the second geometry are equal, which means if the third geometry contains the first one, the third one contains the second as well.

However, when querying the Contains pairs, besides reporting that the first and second geometries contain each other (1,2; 2,1), PostGIS just answers that the third geometry contains the first geometry (3,1), instead of both the first and the second geometries (3,1;3,2), which seems a bug.

The version is the newest on 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"