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_Intersection give results that are inconsistent with ST_Distance #2

Open
nbvfgh opened this issue Jan 9, 2025 · 1 comment
Open
Labels
bug Something isn't working confirmed jts libgeos

Comments

@nbvfgh
Copy link
Owner

nbvfgh commented Jan 9, 2025

SELECT ST_Distance(geom.a, geom.b), ST_AsText(ST_Intersection(geom.a, geom.b))
    FROM (SELECT ST_GeomFromText('POLYGON ((2 0, 0 2, 0 0, 2 0))') As a,
    ST_GeomFromText('POINT(0.4 1.6)') As b) As geom;
-- expected: {0, POINT(0.4, 1.6)}
-- actual  : {0, POINT EMPTY}

ST_Intersection: Returns a geometry representing the point-set intersection of two geometries. In other words, that portion of geometry A and geometry B that is shared between the two geometries.

The distance from POINT(0.4 1.6)) to LINESTRING(2 0, 0 2) is 0, but the ST_Intersection(a, b) returns EMPTY.

@nbvfgh nbvfgh added bug Something isn't working confirmed libgeos jts labels Jan 9, 2025
@nbvfgh
Copy link
Owner Author

nbvfgh commented Jan 9, 2025

bug tracker: libgeos/geos#1207

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed jts libgeos
Projects
None yet
Development

No branches or pull requests

1 participant