Skip to content

Conversation

@spwoodcock
Copy link

Issue

  • While the MBTiles spec says that maxzoom, minzoom, center, bounds should all be included in the metadata table, sometimes they aren't unfortunately.
  • We can rely on maxzoom and minzoom, as they are used by underlying tools a fair bit.
  • The bounds and center metadata are still useful to underlying tools, but not always used.
  • QGIS loads an MBTiles file without these params set, no problem.
  • Ideally the conversion shouldn't fail if they aren't all present.

Solution

  • I kept the minzoom and maxzoom params as mandatory. If omitted, the code fails attempting to index them.
  • I added defaults for:
    • bounds: global bounds
    • center: take the center point of the provided bounds.

@spwoodcock
Copy link
Author

I made a plugin to convert mbtiles --> pmtiles, but the conversion fails with pmtiles==3.5.0 due to missing 'center' in the metadata. This MBTiles was generated by QGIS, so it's probably pretty common to have the center metadata missing:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant