Closed russss closed 1 year ago
Can you share the mbtiles
file?
Is it possible that the center/bounds are defaulting to the world and it just not visible at the scale when loaded in JS?
I dug into this a bit more, hopefully this explains it better:
.mbtiles
file from a bunch of pbf files using mb-util. There was no metadata file included, so the metadata
table in the resulting mbtiles database was empty..pmtiles
file from this .mbtiles
file, which results in the pmtiles file having a value of 0 for all the bounds. (Full pmtiles show
output included below.) [0,0,0,0]
, which results in the pmtiles
file being silently ignored.I'd suggest that the pmtiles command should refuse to create files with an invalid bounding box such as this, or at least issue a warning. I'd also suggest that the JS library should probably issue a warning if the pmtiles file has an invalid bounding box.
We can either
1) error out when the bounds is invalid - has an area or 0, or the min is greater than max, out of the coordinate system, etc 2) detect the error cases but default the bounds to -180,-90,180,90.
I have a slight preference for 2 because the MBTiles spec uses the SHOULD language (a valid bounds is not a hard requirement)
opened a PR: https://github.com/protomaps/go-pmtiles/pull/77
bounds
is missing from MBTiles, default it to the web mercator world -180,-90,180,90.@russss this should be resolved by https://github.com/protomaps/go-pmtiles/releases/tag/v1.10.0 which will fail if a zero-area bounds is passed, but accept no bounds. Please re-open if this is still an issue!
I think if you use the
pmtiles
command line tool to convert anmbtiles
into apmtiles
file, and thembtiles
doesn't have bounds/center metadata, then you get a successfully-generatedpmtiles
file which the JS library (at least) will silently ignore.I'm 80% sure this is what's happening, but I don't have the time to dig into the code to confirm at the moment (sorry).