You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases I'm seeing invalid GeoJSON Polygons passed to the map step. It looks like features that consist of multiple exterior polygons are being converted from vector tiles to a GeoJSON Polygon instead of a GeoJSON MultiPolygon.
Then, when these Polygons are used with turf.intersect(), it throws an "TopologyError: side location conflict" exception.
This simply processes the one tile of interest (15 9378 12535), outputs the feature in the tile, and attempts a turf.intersect() which throws an exception. Note that the feature as passed to the map function is a Polygon, not a MultiPolygon as tippecanoe-decode produces for the same tile.
Converting the Polygon to a MultiPolygon manually allows the turf.intersect() to work.
This is an upstream issue in vector-tile-js, see mapbox/vector-tile-js#33. It was not possible to fix in earlier vector spec, but will be ready to land once vector-tile-spec version 2 becomes the production version at Mapbox (which is happening any time these days).
In some cases I'm seeing invalid GeoJSON Polygons passed to the map step. It looks like features that consist of multiple exterior polygons are being converted from vector tiles to a GeoJSON Polygon instead of a GeoJSON MultiPolygon.
Then, when these Polygons are used with turf.intersect(), it throws an "TopologyError: side location conflict" exception.
Here's a test case that shows the problem.
Input file: dc.json https://gist.github.com/jamesbursa/2026d7338b7a3d227732#file-dc-json
Convert to MBTiles using Tippecanoe:
Decode one tile with tippecanoe-decode:
Note that the output is correctly a MultiPolygon (containing 4 Polygons). See https://gist.github.com/jamesbursa/2026d7338b7a3d227732#file-tile-json
Run through a test TileReduce:
https://gist.github.com/jamesbursa/2026d7338b7a3d227732#file-tilereduce_test-js
https://gist.github.com/jamesbursa/2026d7338b7a3d227732#file-tilereduce_test_map-js
This simply processes the one tile of interest (15 9378 12535), outputs the feature in the tile, and attempts a turf.intersect() which throws an exception. Note that the feature as passed to the map function is a Polygon, not a MultiPolygon as tippecanoe-decode produces for the same tile.
Converting the Polygon to a MultiPolygon manually allows the turf.intersect() to work.
The text was updated successfully, but these errors were encountered: