-
Notifications
You must be signed in to change notification settings - Fork 429
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
Cut inner ring from outer ring when edge is colinear #97
Comments
For what it's worth, geojson-vt doesn't do this, and leaves both rings on the edge, so if this is a requirement, it probably needs to do it too. Example donut and as clipped by geojson-vt and (not yet merged to master) tippecanoe: https://gist.github.com/ericfischer/ea8e7c6545390871a705 |
@ericfischer do you mean there should be no degenerate edges at the top and the bottom in the example? This is what full clipping with StrictlySimple would do, although I don't think this is required for Earcut tessellation. "Artifacts" like this are not harmful and often expected on clipping algorithms like Sutherland-Hodgeman. |
@mourner I am satisfied with the current (Sutherland-Hodgeman) behavior but got the impression from @springmeyer that StrictlySimple-style clipping to remove the degenerate edges was now required. @springmeyer can you clarify? |
@ericfischer I mean, for guaranteed valid polygons, you have to run StrictlySimple-style clipping post-processing on all tiles. There's no point doing something specifically for the case above without addressing any other possible artifacts (mainly caused by simplification). |
OK. But is strict simplicity for polygons now required, or isn't it? |
@ericfischer it will be if we want to rip the benefits of much faster tessellation on both GL JS and GL Native. |
Thanks @mourner. I'm changing tippecanoe now to use Clipper instead of my own clipping implementation. |
Hmm. I am using Clipper with StrictlySimple now, and getting exactly the same result back: an outer polygon and inner hole, not two outer rings. I wonder how mapnik is seeing anything different. |
Okay, then perhaps I'm wrong. Let's lean on @jakepruitt to confirm exactly what mapnik-vt is producing. |
Doing another StrictlySimple after simplifying and scaling produces two outer rings. |
@springmeyer says that when mapnik-vt clips a polygon with a hole along a line that cuts through both the inner and outer ring, it turns it into a single ring with the hole cut out instead of two rings with a colinear edge, and that tippecanoe should do this too.
The text was updated successfully, but these errors were encountered: