diff --git a/docs/development.adoc b/docs/development.adoc index 7635a61..5f05856 100644 --- a/docs/development.adoc +++ b/docs/development.adoc @@ -71,10 +71,10 @@ and similar, varying by region): [source,shell] ---- -pmtiles extract https://download.mapterhorn.com/planet.pmtiles planet-extract.pmtiles --bbox=west,south,east,north --maxzoom=15 --overfetch=0 +pmtiles extract https://download.mapterhorn.com/planet.pmtiles planet-extract.pmtiles --bbox=west,south,east,north --maxzoom=13 --overfetch=0 # only if a regional chunk covers the bbox too (see download_urls.json) — # most bboxes hit exactly one, a bbox straddling a chunk boundary hits two: -pmtiles extract https://download.mapterhorn.com/.pmtiles chunk-extract.pmtiles --bbox=west,south,east,north --maxzoom=15 --overfetch=0 +pmtiles extract https://download.mapterhorn.com/.pmtiles chunk-extract.pmtiles --bbox=west,south,east,north --maxzoom=13 --overfetch=0 pmtiles merge planet-extract.pmtiles chunk-extract.pmtiles data/terrain.pmtiles ---- @@ -88,6 +88,14 @@ fragile mega-request for many small ones instead (spread over connection only loses one small request's worth of progress, not the whole extract. +`--maxzoom=13`: raster DEM tiles don't compress away like vector ones do +(every tile is a real image, even over flat/empty terrain), so each extra +zoom level roughly quadruples storage — the app's own build +(`PmtilesBuilder::TERRAIN_MAX_ZOOM`) caps at 13, each regional chunk's +own native minzoom, rather than the online hillshade layer's z15. A +12-country selection at z15 was headed well past 181GB; z13 is still +plenty for the hillshade toggle and the planned slope readout. + Tiles are 512px WebP, not the 256px PNG this app's *online* Terrarium source uses — `public/js/dem.js`'s own point-elevation lookups (`shadow.js`'s terrain-shadow overlay) read the actual decoded tile diff --git a/lib/maptool/pmtiles_builder.rb b/lib/maptool/pmtiles_builder.rb index 5fec547..f7966e7 100644 --- a/lib/maptool/pmtiles_builder.rb +++ b/lib/maptool/pmtiles_builder.rb @@ -88,11 +88,15 @@ module Maptool # archive" story via go-pmtiles, unrelated to the basemap swap. MAPTERHORN_MANIFEST_URL = "https://download.mapterhorn.com/download_urls.json" MAPTERHORN_PLANET_NAME = "planet.pmtiles" - # Matches the online hillshade layer's own cap (public/js/overlays.js's - # ONLINE_TERRAIN_TILES source, maxzoom: 15) — applied uniformly even - # though some Mapterhorn chunks natively offer more, so the offline - # experience doesn't vary in detail from one region to the next. - TERRAIN_MAX_ZOOM = 15 + # Deliberately *below* the online hillshade layer's own cap + # (public/js/overlays.js's ONLINE_TERRAIN_TILES source, maxzoom: 15) — + # raster DEM tiles don't compress away like vector ones do, so every + # extra zoom level roughly quadruples storage. z13 is each regional + # chunk's own native minzoom (see the comment above), so this is the + # cheapest useful cut: one raster level per chunk, not a 15-13=2-level + # pyramid on top of it. Bumped into a 181GB terrain.pmtiles for a + # 5-country selection before this was lowered — see docs/development.adoc. + TERRAIN_MAX_ZOOM = 13 OFFLINE_STATUS = { state: "idle" } TERRAIN_STATUS = { state: "idle" }