-
Notifications
You must be signed in to change notification settings - Fork 369
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
Within function doesn't consider POINT A is within a GEOMETRYCOLLECTION containing A. #982
Comments
Reproduces for me under GEOS test.
|
The control runs all the way down into RelateOp, and the DE9IM matrix returned looks bad to me.
Says there's no interior/interior interaction. Meanwhile, just looking at points.
Same in JTS @dr-jts ? |
JTS doesn't support predicates on GeometryCollections - that is a GEOS extension. And it's tricky to do - as evidenced by this bug. |
This is one of those tricky cases which arise when working with mixed-type GeometryCollections. It's also running into the well-known quirk of the OGC semantics for Under the OGC definition of The OGC SF doesn't really define the semantics for the topology of GeometryCollections. A reasonable approach is to treat the GC as if it is the Union of its elements. This gives a well-founded basis for evaluating the topology. In this case, that determines that the LineString "absorbs" the Point, so the location (0 0) is in the Boundary of the GC. This gives:
However, at the moment the GEOS logic uses a "last-one-wins" approach to computing the boundary points. This is what is causing the asymmetry of the |
Consider the following statement:
According to the definition of ST_Within and interior of POINT, geometry a1 is within a2
If the
POINT(0 0)
is behindLINESTRING(0 0, 1 0)
(such as a3), Postgis gives the correct answer for ST_Within(a1, a3).When the
POINT(0 0)
is in front ofLINESTRING(0 0, 1 0)
that is shown in a2, Postgis doesn't consider the 'Within' relationship.ST_With(a1,a2) and ST_Within (a1, a2) give different results while the only difference between a2 and a3 is the order of the linestring and the point. It makes me believe it is a functional issue.
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"
The text was updated successfully, but these errors were encountered: