The mbtiles-extracts library checks to see if a tile center lies within a geojson polygon using the which-polygon library.
However, there are times when the tile center does not lie within the geojson polygon, even though parts of the polygon are present in the tile as seen in the diagram below:
The
mbtiles-extracts
library checks to see if a tile center lies within a geojson polygon using thewhich-polygon
library.However, there are times when the tile center does not lie within the geojson polygon, even though parts of the polygon are present in the tile as seen in the diagram below:
Solution
Check if the tile bounding box intersects with the polygon to extract a tile as explained in https://github.com/mapbox/mbtiles-extracts/issues/10#issuecomment-437370452
cc/ @mourner @answerquest