-
Notifications
You must be signed in to change notification settings - Fork 565
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
Intersection of two overlapping polygons results in a single point #1061
Comments
I can reproduce this with the exception that the red polygon appears to have a whole where yours does not. But I think that is mostly a distraction to the issue here since I get the same point you do. My specs are only slightly different from yours so I'll just include a GEOS version: Both polygons report as Edit: This behavior reminds me of #1045. |
It seems I did not check for interiors, thanks for pointing out the hole in the polygon. But I agree, this should nonetheless return a polygon instead of a point. My GEOS version is the same as yours: |
I can also reproduce the single point result with latest Shapely (using GEOS 3.8). The polgyon that I get is:
|
I confirm that this was an issue in GEOS versions <= 3.8, and is is fixed in GEOS 3.9. |
I opened a PR to add this as a test case to GEOS: libgeos/geos#385 This will be fixed once new Shapely packages are released using GEOS 3.9, for the rest nothing to do about it in Shapely itself, so closing this issue. @GetPastTheMonkey thanks for the report! |
Expected behavior and actual behavior.
I have the following two polygons that I would like to intersect:
Expected behavior: The intersection of these two polygons should be a polygon (the area which is shaded red and yellow)
Actual behavior: The intersection results in a single point (the black dot in the image)
Steps to reproduce the problem.
The polygons are generated using data provided by OpenStreetMap. I am not able to provide you the script that generated the polygons. But I can give you the polygons:
Red polygon:
Yellow polygon:
After loading the polygons, run
yellow_polygon.intersection(red_polygon)
which results in the intersection point'POINT (8.9176630604334 47.165388105786)'
instead of a polygon.Operating system
Ubuntu 20.04 LTS
Python 3.8.5
Shapely version and provenance
Shapely 1.8.dev0
Installed from GitHub using pip
(
pip install git+https://github.com/Toblerity/Shapely.git#egg=Shapely
)The text was updated successfully, but these errors were encountered: