-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Misattributed hole with intersection #96
Comments
I think when polygons have holes, you need to use the MultiPolygon format http://geojson.org/geojson-spec.html#id7 instead of polygon: https://gist.github.com/davebrent/28a686e7555f0e65f0859a6994bce5c0#file-index-js-L21 In my usage, martinez.intersection should return a MultiPolygon in this case. |
Hi Jake thanks but that's not my understanding. A What I think is happening here is that the ring representing the hole in one polygon is being assigned to a different one on output |
Right, my point was that you will always get a
You are right, the intersection is dividing the input (a poly with a hole) into 2. You can see from the I made a similar gist with the example from #38 by @joelgallant: https://gist.github.com/jakeNiemiec/7d75093e5e8d9fe52008871c109bb855#file-actual-json (I was unable to get the codepen example by @w8r to load) This example shows the same problem, but with martinez.diff: With this, you can see that the holes are, again, misattributed to the poly that is the furthest from the origin. These problems seem reflected in another popular issue by @erikh2000 from nearly a year ago. TL;DR: When a subject is divided into 2 polys via diff or intersection clipping, all of the subjects holes seem to be misattributed to the poly furthest from the origin. (or the last poly in a multipoly?) |
Think this is all resolved now from #113 |
Ive put together a little gist of the issue here. It seems that the hole in this case is being assigned to the split polygon above rather than the polygon it belonged to.
I think this may be similar to #38?
The problem
Expected result
The text was updated successfully, but these errors were encountered: