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 returns invalid Linestring with Polygon and Linestring #1205

Open
nbvfgh opened this issue Dec 6, 2024 · 3 comments
Open
Labels
Enhancement New feature or feature improvement.

Comments

@nbvfgh
Copy link

nbvfgh commented Dec 6, 2024

Take the intersection of the polygon and line string shown in the following figure:
图片

SELECT ST_AsText(ST_Intersection(geom.b, geom.a))AS intersection 
    FROM (SELECT ST_GeomFromText('POLYGON ((2 0, 0 2, 2 2, 2 0))') As a,
    ST_GeomFromText('LINESTRING(0 0, 0.4 1.6, 1 0)') As b) As geom;

-- expected : {Point(0.4, 1.6)}
-- actual   : {LINESTRING(0.4 1.6,0.4 1.6)}

And the returned Linestring is invalid:

SELECT ST_IsValid('LINESTRING(0.4 1.6,0.4 1.6)');

-- result : {f}

Version Info:
GEOS="3.13.0-CAPI-1.19.0"

@dr-jts dr-jts changed the title ST_Intersection return a invalid Linestring with Polygon and Linestring ST_Intersection returns invalid Linestring with Polygon and Linestring Dec 9, 2024
@dr-jts
Copy link
Contributor

dr-jts commented Dec 9, 2024

This is essentially the same issue as #1136.

@nbvfgh
Copy link
Author

nbvfgh commented Dec 10, 2024

I wonder if this is a bug or if it's pre-defined. Thank you.

This is essentially the same issue as #1136.

@dr-jts
Copy link
Contributor

dr-jts commented Dec 10, 2024

I wonder if this is a bug or if it's pre-defined.

It's more of a design choice than a bug. And it seems that it's an unpopular one :)

@dr-jts dr-jts added the Enhancement New feature or feature improvement. label Dec 19, 2024
@libgeos libgeos deleted a comment from nbvfgh Dec 19, 2024
@libgeos libgeos deleted a comment from nbvfgh Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or feature improvement.
Projects
None yet
Development

No branches or pull requests

2 participants