-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
404 with some (big?) pmtiles #6
Comments
reproduced with master go build
./go-pmtiles serve ./
# working
curl -I http://localhost:8080/Bugianen_Cervino/16/34100/23382.jpg
HTTP/1.1 200 OK
# broken
curl http://localhost:8080/Bugianen/metadata ; echo
{"bounds": "6.592,44.024,8.789,46.498", "name": "Bugianen", "type": "baselayer", "version": "1.1", "description": "https://tartamillo.wordpress.com/bugianen/", "format": "jpg"}
curl -I http://localhost:8080/Bugianen/16/34100/23382.jpg
HTTP/1.1 404 Not Found Adding some logs in reader.go ParseDirectory: logger.Printf("Got %d entries, %d leaves, LeafZ=%d.", len(the_dir.Entries), len(the_dir.Leaves), maxz) working:
broken:
|
working pmtiles-show Bugianen_Cervino.pmtiles
root entries: 8525 broken
So "broken" has 3 leaf directories. But since it has 0 entries we fal into if len(root_value.directory.Entries) == 0 {
return 404, headers, nil
}
If I remove this block of code, it works 🏄 |
Do you have this working successfully with the python pmtiles-convert? that implementation supports writing leaf directories, while the go one doesn't yet. |
nvm, I misread that - the go-pmtiles writer library doesn't support leaf directories yet, but the reader should. let me look more into it |
start with my very last comment -- it works, modulo the regression introduced by 00d3f47 I guess it's also unusual that my files end up with 0 entries in root dir, because they don't have low (<7) zoom levels. |
OK, I understand it now. You're right that the go reader code should be permissive of the root directory having no actual tile entries and only leaf directories. However, it does seem non-optimal to organize things that way - did you create the PMTiles archive via the python converter? can you share your original MBTiles or other source to see if the algorithm can be adapted to produce a more optimized directory layout? |
yes
|
fix deployed on the server, so there's real-life testing possible with the links above now, and it's indeed quite faster than pmtiles-js thx to parallelisation & caching :-) |
about the not optimized code - adressed in #23 this is the code in pmtiles/writer.py that you think is "not optimized" (not such a big issue IMO): you're hardcoding a "base_zoom = 7", which is only only optimal for a whole world map. by the way, funnny you did a fix for the corresponding issue in pmtile-convert: protomaps/PMTiles@f439b3b "handle case where there are not root tiles, only leaf directories" |
The go-pmtiles tool now writes the new and improved spec v3 format, which does not have any concept of a fixed leaf zoom. You can migrate v2 archives using There is still an outstanding issue of how to best organize the root directory to use the fixed root request size of 16,384 bytes efficiently in #16. |
TL;DR I can't get tiles out of go-pmtiles v0.5 for some files which work well through pmtiles-js.
I suspect it is linked with the file having leaf directories.
Context
I am integrating some pmtiles maps in https://opoto.github.io/wtracks/
After merging pmtiles support (opoto/wtracks#21), I have working, but excruciatingly slow pmtiles-js-on-HTTP1 maps (that we discussed in protomaps/PMTiles#16). For example IT Bugianen (find it in More... menu or though the custom link above)
Now I'm trying to evaluate performance on go-pmtiles on the same map, but it does not work (metadata works 404 on tiles I tried).
See the links to download/test the files above. I including a valid file to show that the issue is not how my server setup on montagne.top.
To test on wtracks, search for a covered area for both maps eg "Aosta".
Or test with curl:
I can try to debug it myself at some point, but figured maybe it's a known issue with big files?
The text was updated successfully, but these errors were encountered: