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

ContainsProperly returns true when POINT A is on the boundary of Geometry B #15

Open
cuteDen-ECNU opened this issue Oct 30, 2023 · 1 comment
Labels
bug-confirm libgeos sytax trans Add point to the boundary of geometry

Comments

@cuteDen-ECNU
Copy link
Owner

cuteDen-ECNU commented Oct 30, 2023

Consider the following statement:

SELECT ST_ContainsProperly(a1, a2)
FROM ST_GeomFromText('GEOMETRYCOLLECTION(LINESTRING(0 1, 0 0),POINT(0 0))') As a1
,ST_GeomFromText('POINT(0 0)') As a2;
--expected{f}, actual{t}

ST_ContainsProperly(a1, a2) returned true, which is not expected.
According to the definition, ContainsProperly returns false when the point of a1 is on the boundary of a2.

Returns true if every point of B lies in the interior of A (or equivalently, no point of B lies in the boundary or exterior of A).
In mathematical terms: ST_ContainsProperly(A, B) ⇔ Int(A) ⋂ B = B

The boundary of a1 (MULTIPOINT((0 1),(0 0), EMPTY)) contains a2, thus, We expect that ContainsProperly returns false.

SELECT ST_AsText(ST_Boundary(a1)), ST_Contains(ST_Boundary(a1), a2)
FROM ST_GeomFromText('GEOMETRYCOLLECTION(LINESTRING(0 1, 0 0),POINT(0 0))') As a1
, ST_GeomFromText('POINT(0 0)') As a2;
--            st_astext           | st_contains 
-- -------------------------------+-------------
--  MULTIPOINT((0 1),(0 0),EMPTY) | t
-- (1 row)

The version is the lastest:
POSTGIS="3.5.0dev 3.4.0rc1-705-g5c3ec8392" [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 cuteDen-ECNU added the sytax trans Add point to the boundary of geometry label Nov 1, 2023
@cuteDen-ECNU
Copy link
Owner Author

cuteDen-ECNU commented Nov 1, 2023

bugtracker link: libgeos/geos#981

@cuteDen-ECNU cuteDen-ECNU added bug-confirm duplicate This issue or pull request already exists and removed reported duplicate This issue or pull request already exists labels Nov 4, 2023
@muchang muchang added the duplicate This issue or pull request already exists label Nov 4, 2023
@cuteDen-ECNU cuteDen-ECNU added bug-confirm and removed duplicate This issue or pull request already exists labels Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-confirm libgeos sytax trans Add point to the boundary of geometry
Projects
None yet
Development

No branches or pull requests

2 participants