However rendering osm data I encountered a situation where geometry collections still hit the encoder_visitor (or maybe it was the simplify_visitor?). Either way, this is unexpected. I would expect that if this check is working then no geometry collections would ever be encountered in the visitors. Not unless boost::geometry::simplify could create collections?
testcase to try to replicate a collection being passed into handle_geometry
if there are actually valid situations where a collection could be passed to handle_geometry (which I doubt) then we should handle them somehow instead of throwing. Perhaps we could track the original geometry type: if it was a polygon and then a collection of polygon+point was encountered we could encode the polygon and skip the point. But really I can't see how collections should even get into handle_geometry in the first place
Special handling to encode each component part of a geometry collection was added here: https://github.com/mapbox/mapnik-vector-tile/blob/887e82a1011f02ad9ef0aa756018b03e6665c81d/src/vector_tile_processor.ipp#L799-L812 to solve #98.
However rendering osm data I encountered a situation where geometry collections still hit the
encoder_visitor
(or maybe it was thesimplify_visitor
?). Either way, this is unexpected. I would expect that if this check is working then no geometry collections would ever be encountered in the visitors. Not unlessboost::geometry::simplify
could create collections?Anyway, this ticket captures the reason I disabled collections hastily in https://github.com/mapbox/mapnik-vector-tile/commit/dee4e3a332e8c5ee23952439b787a02057a90ce3
The next action is:
handle_geometry
handle_geometry
(which I doubt) then we should handle them somehow instead of throwing. Perhaps we could track the original geometry type: if it was apolygon
and then a collection ofpolygon+point
was encountered we could encode the polygon and skip the point. But really I can't see how collections should even get intohandle_geometry
in the first place