consbio / tpkutils

ArcGIS Tile Package Utilities
Other
112 stars 28 forks source link

Avoid bug when converting tpks that have entire zoom levels of empty tiles #29

Closed nikmolnar closed 2 years ago

nikmolnar commented 2 years ago

TPKs may have zoom levels for which all tiles are empty. For example, a tile package may have non-empty tiles up to level 16, but then have levels 17-23 filled with empty tiles (I'm unsure what generation settings at cause this but have seen such packages in the wild).

This PR avoids an exception caused by this situation by refining the available zooms (and thus the max zoom) according to non-empty tiles so that the highest_zoom value represents a zoom level actually present in the newly-created mbtiles database when --drop-emtpy is used.