Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ST_Covers missed one of the pairs #34

Closed
cuteDen-ECNU opened this issue Dec 6, 2023 · 1 comment
Closed

ST_Covers missed one of the pairs #34

cuteDen-ECNU opened this issue Dec 6, 2023 · 1 comment

Comments

@cuteDen-ECNU
Copy link
Owner

cuteDen-ECNU commented Dec 6, 2023

Consider the following statement:

DROP TABLE IF EXISTS origin; 
CREATE TABLE origin (id int, geom geometry);
INSERT INTO origin (id, geom) VALUES (1,ST_MLineFromText('MULTILINESTRING((75 16,26 51 ))',0));
INSERT INTO origin (id, geom) VALUES (2,ST_LineFromText('LINESTRING(26 16,75 51)',0)); 
INSERT INTO origin (id, geom) SELECT 3, ST_GeomFromText('GEOMETRYCOLLECTION(POLYGON EMPTY,MULTILINESTRING((75 16,26 51)))', 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{3, 1}; expected{3, 1; 1, 3}

The expected result should be {3, 1; 1, 3} because the first geometry covers the third geometry:

SELECT ST_Covers(a1.geom, a2.geom) FROM origin As a1, origin As a2 WHERE a1.id = 1 and a2.id = 3;
-- True

However, the answer that PostGIS gives just contains {3, 1}, which seems a bug.

Version:

 POSTGIS="3.5.0dev 3.4.0rc1-830-g8f77e8a6b" [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"
@cuteDen-ECNU
Copy link
Owner Author

Same as #36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant