2

I am working with the mbtiles-extracts library: https://github.com/mapbox/mbtiles-extracts. Given an mbtiles file and a geojson, the library extracts mbtiles cutouts of the polygons in the geojson.

Except, it does not work for some geojsons.

As documented in https://github.com/mapbox/mbtiles-extracts/issues/10, it does not work for any polygon present in the following geojson for the mbtiles listed below:

When I debug, I see that:

As suggested by Nikhil V J on https://lists.openstreetmap.org/pipermail/talk-in/2018-November/003211.html, I also tried validating the geojsons, and ensuring that they follow the right hand verification rule, but that did not fix things.

Any help in understanding why these polygons are different from other polygons, or if there's a pattern to these polygons that I am missing, would be really helpful!

2
  • Can you give an example of input arguments, the "falsy" value and what was expected?
    – Nikhil VJ
    Nov 9, 2018 at 8:06
  • The geojson referenced above, and the mbtiles referenced above can help you figure that out. The function returning a "falsy" value checks to see if a lng, lat within a tile (tile center?) intersects a polygon in the geojson to qualify feature extraction from the intersection of the tile bbox and the polygon. It seems that this assumption is not always true, and hence leads to some polygons being excluded from the extraction. More at github.com/mapbox/mbtiles-extracts/issues/…
    – user81371
    Nov 9, 2018 at 13:23

1 Answer 1

0

I figured out what was causing this issue. The issue is explained in detail at https://github.com/mapbox/mbtiles-extracts/issues/12, and was a bug with the mbtiles-extracts library. It is resolved in a PR at https://github.com/mapbox/mbtiles-extracts/pull/14.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.