Incorrect header maxzoom for Google-Microsoft Open Building dataset PMTiles
Closed this issue · 7 comments
The Google-Microsoft Open Buildings on source.coop @jedsundwall has an incorrect header of 15 when it should be 13 to over zoom correctly. See PMTiles Viewer. The building layer disappears when zoom level is higher than 13, making it infeasible to see the details of building footprints. According to the tweet by @bdon, there might be a missing piece of functionality in tippecanoe's tile-join.
I'm not sure how PMTiles are built, but on a global scale you may be looking at a billion tiles at zoom 15. That zoom level could be intentional for size reasons.
if we can't see the details of the building footprints, then the dataset become less useful.
I couldn't agree more. If you're using OSM base map, it has footprints, that's where the > 13 zoom becomes critical. FlatGeobuf is lossless, easy to consume, perfect for high zoom and you can interact with them on Leaflet. Bonus, you don't have to wrestle with the whole parquet debacle.
There are certain parts of the dataset that include z15 data, so the maxzoom
is actually correct
Based on the metadata the tileset was generated using many tile-join
operations. If you tile-join
tilesets with different maxzooms, then the lower-maxzoom tileset needs to have its data over zoomed to match the higher-maxzoom tileset. @e-n-f should this be the default behavior? Otherwise it's easy to create tilesets without proper overzooming.
ogr2ogr naturalearth/110m_cultural/ne_110m_admin_1_states_provinces.shp -f GeoJsonSeq | tippecanoe -o states.pmtiles --maximum-zoom=5
ogr2ogr naturalearth/110m_cultural/ne_110m_admin_0_countries.shp -f GeoJsonSeq | tippecanoe -o countries.pmtiles --maximum-zoom=4
creates correct archives with maxzoom=5 and maxzoom=4 respectively.
./tile-join countries.pmtiles states.pmtiles -o joined.pmtiles
Warning: mismatched maxzooms: 4 in countries.pmtiles vs previous 5
Reproduces the display problem.
![Screenshot 2023-09-27 at 11 49 40](https://private-user-images.githubusercontent.com/77501/270856883-d7ef6f4a-9f6e-4b5d-907d-9f92409a021f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUxNDgzNjQsIm5iZiI6MTcyNTE0ODA2NCwicGF0aCI6Ii83NzUwMS8yNzA4NTY4ODMtZDdlZjZmNGEtOWY2ZS00YjVkLTkwN2QtOWY5MjQwOWEwMjFmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODMxVDIzNDc0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQzMTBlZTlhYWQ4MzUzMTU4YTg5OTMxOTI3Njk1YjNhN2Q2NmZmZmFjMDk3YjZkZWIwNTQzOWVmZDc2ZDE5MzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.UFUnrpSyiYNXAuLbOyJI-SWKlbJEWsQ_42yh5PFep5A)
./tile-join countries.pmtiles states.pmtiles -o joined.pmtiles --overzoom
correct!
![Screenshot 2023-09-27 at 11 51 22](https://private-user-images.githubusercontent.com/77501/270857038-ea9f495c-6f74-4d59-a0db-59f1d2f07c6e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUxNDgzNjQsIm5iZiI6MTcyNTE0ODA2NCwicGF0aCI6Ii83NzUwMS8yNzA4NTcwMzgtZWE5ZjQ5NWMtNmY3NC00ZDU5LWEwZGItNTlmMWQyZjA3YzZlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODMxVDIzNDc0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU3MzY4YzMxMGJmMDJhZTc0MmQwNmNjMDVjMzM4NGU2Mjg2MTY0YzEzYmQyODQ5NjhjNmQ2NzkxZGUwODk5NGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.kxfz4_HFNdVvuYn8n-LRfCiNbYW47dZUJvFq7Sa0e4I)
So the publishers of the original dataset need to be passing --overzoom
to tile-join
. A warning is being emitted, but it should probably be a scarier warning about broken overzoom behavior, or we should make overzooming the default (and add a --no-overzoom
option?
Publisher of the dataset here, thanks for picking this up 🙏
We indeed used tile-join
in order to apply a parallel processing strategy by first creating PMTiles per country in parallel and then tile-joining them. This needs quite a bit of memory but is a significantly faster approach compared to using Tippecanoe directly on the global dataset. We were aware of some overzooming issues, but did not know that tile-joining different zoom levels does not work correctly without the --overzoom
flag. We've updated the dataset on Source Cooperative (created using the direct Tippecanoe approach), with the correct zoom levels up to 15.
I will create a MR for:
- updating the docs, mentioning the broken overzoom behaviour when tile-joining dataset with different zoom levels
- A better warning, stating the broken overzoom behaviour.
@dvd3v Thank you for fixing it so quickly and thank you @bdon for debugging the issue. So nice to see the crystal clear building footprints!
Web app: https://apps.opengeos.org/buildings.html
Notebook: https://leafmap.org/notebooks/82_pmtiles
![Screenshot 2023-09-27 at 7 38 51 AM](https://private-user-images.githubusercontent.com/5016453/270966431-02f40f31-2c1a-4ec2-bd4a-f57a17d3694e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUxNDgzNjQsIm5iZiI6MTcyNTE0ODA2NCwicGF0aCI6Ii81MDE2NDUzLzI3MDk2NjQzMS0wMmY0MGYzMS0yYzFhLTRlYzItYmQ0YS1mNTdhMTdkMzY5NGUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgzMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MzFUMjM0NzQ0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDU2OTk5NGQ4OGRjMTgyN2NjYjc1OWI4Y2M4NDM3YjQ4YTUxYmM0YjdmODJjMmIzMTJjNGY5YTlmNjU4NTdmMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.8UdjAZN37F1r2ymEUytGT0kDFoSsmp1xqCrBrz2MYzY)