Comments (5)
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?
from go-pmtiles.
I dug into this a bit more, hopefully this explains it better:
- I created an
.mbtiles
file from a bunch of pbf files using mb-util. There was no metadata file included, so themetadata
table in the resulting mbtiles database was empty. - I created a
.pmtiles
file from this.mbtiles
file, which results in the pmtiles file having a value of 0 for all the bounds. (Fullpmtiles show
output included below.) - I try to display this pmtiles file in maplibre-js. MapLibre won't try and fetch tiles if they're outside the source's bounding box, and the pmtiles provider uses the bounds from the header of the pmtiles file, so the bounding box is
[0,0,0,0]
, which results in thepmtiles
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.
Result of `pmtiles show`
$ pmtiles show ./buildmap-nometadata.pmtiles
pmtiles spec version: 3
total size: 24 MB
tile type: Unknown
bounds: 0.000000,0.000000 0.000000,0.000000
min zoom: 7
max zoom: 20
center: 0.000000,0.000000
center zoom: 7
addressed tiles count: 12946
tile entries count: 8418
tile contents count: 5367
clustered: true
internal compression: 2
tile compression: 0
from go-pmtiles.
We can either
- 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
- 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)
from go-pmtiles.
opened a PR: #77
- If the
bounds
is missing from MBTiles, default it to the web mercator world -180,-90,180,90. - If the bounds is zero area or less, raise an error. This should catch the case you have before, in which case you need to provide corrected information in the MBTiles before converting.
from go-pmtiles.
@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!
from go-pmtiles.
Related Issues (20)
- CLI tool to concatenate or merge pmtiles HOT 13
- s3-like compatibility HOT 8
- /health endpoint when serving HOT 10
- Add quiet mode HOT 4
- Slow query for totalTiles in MBTiles -> PMTiles conversion HOT 14
- convert Error parsing mbtiles HOT 4
- arm64 docker images HOT 3
- Corrupted file HOT 8
- SIGSEGV in `pmtiles serve` HOT 3
- dockerfile improvements
- Fails to convert world map due to /tmp space limitations HOT 2
- Invalid help comment for download command HOT 1
- change tmp file location HOT 2
- 404 when trying to serve local PMTiles using the pmtiles CLI HOT 3
- Add ability to get a subset of layers using pmtiles extract HOT 1
- Serving from public s3 bucket HOT 4
- Intergration as a library HOT 3
- CLI: `pmtiles convert INPUT.mbtiles OUTPUT.pmtiles` fails silently for MBTiles v 1.0 HOT 4
- Docker image cannot `convert` HOT 7
- server always sends 404 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-pmtiles.