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

change in the result of polygon-line intersection from versions 3.8.1 to v3.9.0 #408

Closed
davemfish opened this issue Feb 8, 2021 · 3 comments

Comments

@davemfish
Copy link

Apologies for not having a pure geos example. I observe a change in the result of a polygon-line intersection from geos versions 3.8.1 to 3.9.0. My shapely version is the same in both environments (1.7.1)

from shapely.geometry import Polygon, LineString
poly = Polygon(((-200, -200), (200, -200), (200, 200), (-200, 200), (-200, -200)))
line = LineString([(-100, 100), (-100, -100)])
print(poly.intersects(line))                       # always True
print(poly.intersection(line).wkt)                 # LINESTRING EMPTY in version 3.9.0

The intersection is LINESTRING EMPTY according to version 3.9.0, but is LINESTRING (-100 100, -100 -100) according to version 3.8.1.

I'm not entirely sure, is this a bugfix or a regression?

@pramsey
Copy link
Member

pramsey commented Feb 8, 2021

It's a bug, gotta trust my lying eyes. Also confirm this behaviour is happening also on my copy of GEOS, which is state-of-the-art.

geoms

@davemfish
Copy link
Author

Thanks for the confirmation. And thanks for GEOS!

@dr-jts
Copy link
Contributor

dr-jts commented Feb 9, 2021

Fixed in JTS.
Fixed in GEOS 3.10 (e30955844d).
Backported to GEOS 3.9

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

No branches or pull requests

3 participants