-
-
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
coords array: polygon with holes vs multipolygon #44
Comments
@codeofsumit Side topic, we would be using the 👍 @rowanwins Could we use |
Mmm at the moment I think we're just trying to sort out a performance bug @DenisCarriere . We could try and incorporate it into turf and see how the tests and benchmark faired, I'll try and take a look at that this week and will report back |
Actually just dropping another note in here, I've attempted to replace |
difference is broken, as I stated before, but it wasn't before we made changes, so I think we can fix it. |
ahh sorry @w8r I misunderstood that other comment you left, I'll try getting one of the other operations into turf and see if I uncover anything else |
No joy with union either @w8r when using this input I get this output, the hole is nested too deeply |
Very cool that you have examples! |
hey guys, just wanted to ask how it's going on this? @w8r you mentioned |
slow is the answer @codeofsumit :( I'm currently tied up with some turf work for the next week but once that is sorted this is going to be my main priority. |
I am sorry it goes so slow, but I really work on it sporadically. Maybe we can really plan a session when we can sit and resolve that stuff once and for all. I really believe we have lots of test cases and now that the code is simpler, we can fix the problem. Actually holes marking was done by indexing and in the paper it even supports 'islands' as 'holes' of 'holes', which might be the flaw. I really need to sit down and look at it closely |
any updates here? |
Hi @codeofsumit I've made some progress which is available in #42 , although there are still a couple of outstanding issues that occur in very isolated situations. I would say that in 95% of situations you'll likely get a good and predictable result, so whether that is enough for you I'm not sure... |
Oh and ps in the branch mentioned above everything is output as a multipolygon. It may be there that the output only have 1 polygon, but this was we can provide a consistent output in terms of nesting etc. |
@DenisCarriere is it enough to get it into turf? |
It's really close, but not quite sufficient for my liking. |
👍 Agreed! We will definitely add Martinez in Turf! This will open up many new doors for new spatial operations. Looking forward to that day! 🎉 |
will be fixed in #42 |
Hey there, I'm trying to replace turfs
difference
andintersect
with your library in leaflet.pm (drawing plugin for leaflet) due to size.To illustrate the problem I've included gifs of using your library.
When using difference, I'm having a bit trouble figuring out if the result is a MultiPolygon or a Polygon with a hole.
In your examples, you always expect it to be a Multipolygon but if you treat a hole that way - two layers are being drawn.
Using diff on a polygon when the result is a regular polygon
![lpm](https://user-images.githubusercontent.com/2399810/30758598-622b3b08-9fd3-11e7-89f2-05f411b1b285.gif)
Using diff on a polygon, cutting it in half, and the result is a multipolygon:
![lpm2](https://user-images.githubusercontent.com/2399810/30758612-6fc4efe8-9fd3-11e7-9e0b-35cac0291a08.gif)
Using diff on a polygon, cutting a hole in it. The resulting coords array looks exactly like a multipolygon, so both are getting drawn:
![lpm3](https://user-images.githubusercontent.com/2399810/30758641-858582ca-9fd3-11e7-9fef-39c67b1dbb10.gif)
How would you recommend to find out if it's a hole or a multipolygon?
The text was updated successfully, but these errors were encountered: