Conversation
springmeyer
left a comment
There was a problem hiding this comment.
My thoughts are:
- If invalid polygons are being passed to vtcomposite, it is not vtcomposite's job to clean them up. Rather they should be fixed upstream.
- If vtcomposite is creating invalid polygons from valid polygons, this is a bug that should be solvable without needing to depend on wagyu to do cleanup
So, without evidence that wagyu is actually needed here I think this is not the right approach.
src/feature_builder.hpp
Outdated
| } | ||
| mapbox::geometry::multi_polygon<coordinate_type> results; | ||
| mapbox::geometry::wagyu::wagyu<std::int64_t> wagyu; | ||
| bool data_added = false; |
There was a problem hiding this comment.
It seems like it might be clearer to combine data_added and !skip_inner as a single added_outer_ring condition.
|
@springmeyer in the process of clipping you can create an invalid polygon, even if they were valid prior. I honestly do not trust the boost implementation of |
e-n-f
left a comment
There was a problem hiding this comment.
This looks good to me. My questions about why each outer ring and its children are cleaned separately rather than doing the entire geometry together were answered in Slack.
|
@flippmoke Could you add one of the known-bad tiles here as a test case to demonstrate the problem and prevent future regressions? Any easy one to reproduce:
|
The fundamental design of
Don't trust it because you see obvious cases where it will produce valid geometries or don't trust it due to the potential for software bugs?
We needed wagyu at the tile generation stage for the clipping arbitrary input geometries that were potentially invalid because |
@ericfischer how exactly is the output tile being broken by the current implementation? |
|
@springmeyer The best example I have for this is tile 4/13/6 in As you can see here, two of the clipped inner rings have a collinear edge with the right or top side of the outer ring, an invalid geometry that causes triangulation errors and causes the entire tile to be filled instead of just the area excluding the holes. Wagyu correctly cuts both of these out of the outer ring instead. |
|
@springmeyer To be even clearer: the fundamental flaw of the current implementation is that it clips each polygon ring independently instead of considering the feature as a whole, so it will always be wrong when the edge of the clip region intersects a hole. |
|
@ericfischer Clipping individual rings is the issue, I'll look into fixing this. Thanks for providing background here! |
|
Per chat with @ericfischer and @artemp, @artemp is going to create a second branch for comparison and testing purposes that attempts to fix the problem @ericfischer describes clearly at #100 (comment) by changing the usage of For historical reference, wagyu was integrated in an experimental way last year in #45 but abandoned since it was only considered at that time for handling known invalid v1 vector tiles and other workarounds were successful. |
Performance in master: Performance with wagyu: |
|
@ericfischer @flippmoke @springmeyer - Fixed in b404cf2 , working on a test.. |
|
closed for now in favor of #101 |


Currently we can produce rings with the incorrect winding order due to the lack of wagyu being used in our clipping step.