Modern Apps git

← Modern-Apps.git

maps: new app versions download planet5.mamaps (#planet5)

Commit
975b013639693ec8374aef853752aeab2a6e0ab1
Author
Vayun Mathur <[email protected]>
When
2026-11-14 00:54 UTC (22 days ago)
Parents
37211a1
Owner rule: formats installed apps depend on never change in place;
planet5 ships under a new name while planet4 stays published.

- maps MapTileCache: first-launch download is planet5.mamaps; the
  update manifest is planet5.manifest.json. Installs already holding
  a planet4 basemap.mamaps keep reading it (the reader speaks v9 and
  v10) until the planet5 manifest's rebase signal -- the planet5 base
  pinned with an empty overlay list, the same path planet3 -> planet4
  took -- has MapOverlayWorker download planet5 once on an unmetered
  network and swap it in. MapOverlay.MANIFEST_URL now aliases the
  MapTileCache constant instead of repeating it.
- library/map urls.rs: the streamed basemap is planet5.mamaps; the
  cache origin carries the URL, so the first planet5 open drops the
  planet4 ranges (cache test renamed to planet4 -> planet5).
- real_archive test accepts a v9 (planet4) or v10 (planet5) header.
- Docs naming planet4 as the current archive now name planet5.

Older app versions are untouched: they keep fetching planet4.mamaps
and planet4.manifest.json.

Verified: cargo test -p map_renderer (563 pass); real-archive suite
6/6 on planet4 with the new reader; Kotlin tests via gbuild (report).

Diff

library/map/src/main/java/com/vayunmathur/library/map/MapNative.kt
diff --git a/library/map/src/main/java/com/vayunmathur/library/map/MapNative.kt b/library/map/src/main/java/com/vayunmathur/library/map/MapNative.ktindex 0a4e8ae5d1..dc86812056 100644--- a/library/map/src/main/java/com/vayunmathur/library/map/MapNative.kt+++ b/library/map/src/main/java/com/vayunmathur/library/map/MapNative.kt@@ -44,7 +44,7 @@ internal object MapNative {      *      * [localPath] is an optional path to a `.mamaps` archive already on the device. When      * it names an existing file the renderer reads that file directly and does no-     * networking at all; `null` or empty keeps the built-in `planet4.mamaps` URL and its+     * networking at all; `null` or empty keeps the built-in `planet5.mamaps` URL and its      * range cache unchanged.      */     external fun create(
library/map/src/main/java/com/vayunmathur/library/map/MapOptions.kt
diff --git a/library/map/src/main/java/com/vayunmathur/library/map/MapOptions.kt b/library/map/src/main/java/com/vayunmathur/library/map/MapOptions.ktindex 764461b217..91e9ddb1ce 100644--- a/library/map/src/main/java/com/vayunmathur/library/map/MapOptions.kt+++ b/library/map/src/main/java/com/vayunmathur/library/map/MapOptions.kt@@ -70,7 +70,7 @@ data class MapOptions(     val layerOptions: LayerOptions = LayerOptions(),     /**      * Where tiles come from. [TileSource.Server] (default) streams range requests for-     * `planet4.mamaps` over HTTP with a disk range cache; [TileSource.LocalFile] reads a+     * `planet5.mamaps` over HTTP with a disk range cache; [TileSource.LocalFile] reads a      * pushed `.mamaps` archive from the app's external files dir and does no networking.      * Today only `maps` pushes an archive, so every other app stays on the default.      */@@ -95,7 +95,7 @@ enum class MapBody {  * Where the renderer reads its tiles from.  */ enum class TileSource {-    /** Stream `planet4.mamaps` range requests over HTTP, cached on disk. */+    /** Stream `planet5.mamaps` range requests over HTTP, cached on disk. */     Server,     /** Read a pushed `.mamaps` archive from external files; no networking. Falls back to      * [Server] when no archive file is present, so a missing push degrades to streaming
library/map/src/main/java/com/vayunmathur/library/map/VectorMap.kt
diff --git a/library/map/src/main/java/com/vayunmathur/library/map/VectorMap.kt b/library/map/src/main/java/com/vayunmathur/library/map/VectorMap.ktindex 33c62ba70a..e1f1ad5a87 100644--- a/library/map/src/main/java/com/vayunmathur/library/map/VectorMap.kt+++ b/library/map/src/main/java/com/vayunmathur/library/map/VectorMap.kt@@ -47,8 +47,8 @@ internal val MapOnlineDefault: StateFlow<Boolean> = OnlineAlways /**  * The vector map.  *- * Renders the planet-scale single-file `planet4.mamaps` archive- * (`data.maproj.org/planet4.mamaps`: v9 header, v10 bodies, 10 layers, 128-byte header) with our own+ * Renders the planet-scale single-file `planet5.mamaps` archive+ * (`data.maproj.org/planet5.mamaps`: v10 header, dictionary-zstd v11 bodies, 10 layers, 128-byte header; planet4 v9 archives still read) with our own  * Vulkan renderer. No third-party tile CDN and no API key, which is the whole point:  * watermarked, and that broke the basemap in five apps (#615).  *
library/map/src/main/rust/src/lib.rs
diff --git a/library/map/src/main/rust/src/lib.rs b/library/map/src/main/rust/src/lib.rsindex 4dd11b505c..e342a05104 100644--- a/library/map/src/main/rust/src/lib.rs+++ b/library/map/src/main/rust/src/lib.rs@@ -2,7 +2,7 @@ //! //! Replaces the CARTO raster basemap in findfamily, photos, weather, taxi and //! fooddelivery (#615) with our own renderer over the planet-scale-//! single-file `planet4.mamaps` archive at `data.maproj.org/planet4.mamaps`+//! single-file `planet5.mamaps` archive at `data.maproj.org/planet5.mamaps` //! (v9 header, v10 bodies, 10 layers, 128-byte header). //! //! # Layout
library/map/src/main/rust/src/tile/cache/tests.rs
diff --git a/library/map/src/main/rust/src/tile/cache/tests.rs b/library/map/src/main/rust/src/tile/cache/tests.rsindex d8cc9ba3f9..4c8fd0168d 100644--- a/library/map/src/main/rust/src/tile/cache/tests.rs+++ b/library/map/src/main/rust/src/tile/cache/tests.rs@@ -25,8 +25,8 @@ impl Drop for Fixture {     } } -const URL: &str = "https://data.maproj.org/planet4.mamaps";-const ORIGIN: &str = "v1|https://data.maproj.org/planet4.mamaps";+const URL: &str = "https://data.maproj.org/planet5.mamaps";+const ORIGIN: &str = "v1|https://data.maproj.org/planet5.mamaps";  fn cache_with(dir: &Path, clock: Arc<AtomicU64>, max_bytes: u64) -> RangeCache {     let c = clock.clone();@@ -189,15 +189,15 @@ fn changing_the_origin_marker_drops_every_entry() { }  #[test]-fn moving_from_planet3_to_planet4_wipes_the_planet3_ranges() {+fn moving_from_planet4_to_planet5_wipes_the_planet4_ranges() {     // The URL switch must not leave the old archive's ranges beside the new     // ones: the directory is shared (not keyed per URL), and the real origin-    // marker carries the URL, so the first planet4 open drops every planet3+    // marker carries the URL, so the first planet5 open drops every planet4     // entry and the cache never holds both.     use crate::tile::source::{basemap_origin, BASEMAP_ARCHIVE_URL};-    const PLANET3: &str = "https://data.maproj.org/planet3.mamaps";-    assert_eq!(BASEMAP_ARCHIVE_URL, URL, "the renderer reads planet4");-    let f = Fixture::new("planet3to4");+    const PLANET3: &str = "https://data.maproj.org/planet4.mamaps";+    assert_eq!(BASEMAP_ARCHIVE_URL, URL, "the renderer reads planet5");+    let f = Fixture::new("planet4to5");     let clock = || Box::new(|| 1_000_000u64) as Box<dyn Fn() -> u64 + Send + Sync>;     {         let old = RangeCache::with_clock(@@ -217,10 +217,10 @@ fn moving_from_planet3_to_planet4_wipes_the_planet3_ranges() {         DEFAULT_MAX_BYTES,         clock(),     );-    assert_eq!(data_files(&f.dir).len(), 0, "planet3 ranges must be evicted on the switch");+    assert_eq!(data_files(&f.dir).len(), 0, "planet4 ranges must be evicted on the switch");     new.write(&RangeCache::key(BASEMAP_ARCHIVE_URL, "bytes=0-127"), &[0u8; 128]);     assert_eq!(data_files(&f.dir).len(), 1);-    assert!(fs::read_to_string(f.dir.join(ORIGIN_FILE)).unwrap().contains("planet4.mamaps"));+    assert!(fs::read_to_string(f.dir.join(ORIGIN_FILE)).unwrap().contains("planet5.mamaps")); }  #[test]
library/map/src/main/rust/src/tile/source/urls.rs
diff --git a/library/map/src/main/rust/src/tile/source/urls.rs b/library/map/src/main/rust/src/tile/source/urls.rsindex 270304f235..f25adb77a8 100644--- a/library/map/src/main/rust/src/tile/source/urls.rs+++ b/library/map/src/main/rust/src/tile/source/urls.rs@@ -1,11 +1,12 @@ /// Where this renderer reads its tiles from: the planet-scale single-file full `.mamaps`-/// archive (v9 header with v10 bodies, 10 layers, 128-byte header, graph/POI/transit-/// sections behind the `MAMA8` footer).+/// archive. planet5 (v10 header: dictionary-zstd v11 bodies, the dictionaries between the root+/// and the leaves; graph v8 / TRIX v8 sections behind the `MAMA8` footer). The reader still+/// opens planet4 (v9) archives, which stay published for older app versions. /// /// A new URL is a new cache origin: [`basemap_origin`] carries the URL, so the first open-/// against this URL wipes every range cached for the previous archive (planet3) instead of+/// against this URL wipes every range cached for the previous archive (planet4) instead of /// keeping both โ€” the cache directory is shared, not keyed per URL.-pub const BASEMAP_ARCHIVE_URL: &str = "https://data.maproj.org/planet4.mamaps";+pub const BASEMAP_ARCHIVE_URL: &str = "https://data.maproj.org/planet5.mamaps";  /// Bumped when the on-disk cache layout changes, so old entries are dropped rather than /// misread. The URL is in the marker too, because the archive is republished under the
library/map/src/main/rust/tests/real_archive.rs
diff --git a/library/map/src/main/rust/tests/real_archive.rs b/library/map/src/main/rust/tests/real_archive.rsindex 2fd9acca4b..23a255caa3 100644--- a/library/map/src/main/rust/tests/real_archive.rs+++ b/library/map/src/main/rust/tests/real_archive.rs@@ -1,4 +1,4 @@-//! The renderer's reader against a REAL planet archive (`planet4.mamaps`, or the+//! The renderer's reader against a REAL planet archive (`planet4.mamaps` / `planet5.mamaps`, or the //! byte-identical local build `scripts/maps/inputs/world.mamaps`). //! //! Ignored by default and gated on `MAMAPS_REAL_ARCHIVE`, so a normal `cargo test` never@@ -93,7 +93,14 @@ fn header_version_and_dictionary_are_accepted() {         head[7], header.flags, header.compression, header.layer_count, header.min_zoom,         header.max_zoom, header.build_id, header.file_len     );-    assert_eq!(head[7], tilecodec::mamaps::header::FORMAT_VERSION_V9, "planet4 is a v9 archive");+    // planet4 is a v9 archive; planet5 a v10 one (dictionary-zstd bodies). Both must open.+    match head[7] {+        tilecodec::mamaps::header::FORMAT_VERSION_V9 => {}+        tilecodec::mamaps::header::FORMAT_VERSION_HEADER_V10 => {+            assert_eq!(header.compression, tilecodec::mamaps::header::COMPRESSION_ZSTD_DICT);+        }+        v => panic!("planet4 is v9 and planet5 v10, got v{v}"),+    }     assert_eq!(header.file_len, std::fs::metadata(&path).unwrap().len());     assert!(header.compressed() && header.rings_validated() && header.leaves_compressed());     // The header claims validated rings, but the renderer does not trust it (see
maps/src/main/java/com/vayunmathur/maps/util/MapOverlay.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/util/MapOverlay.kt b/maps/src/main/java/com/vayunmathur/maps/util/MapOverlay.ktindex 52f8e09159..f6ab2a2d6a 100644--- a/maps/src/main/java/com/vayunmathur/maps/util/MapOverlay.kt+++ b/maps/src/main/java/com/vayunmathur/maps/util/MapOverlay.kt@@ -11,7 +11,7 @@ import kotlinx.serialization.json.long import kotlinx.serialization.json.int  /**- * The client half of incremental map updates: the `planet4.manifest.json`+ * The client half of incremental map updates: the `planet5.manifest.json`  * model, the on-disk overlay layout, and the queries the Settings UI and the  * check worker drive.  *@@ -32,7 +32,7 @@ import kotlinx.serialization.json.int  */ object MapOverlay {     /** Where [MapTileCache.BASEMAP_ARCHIVE_FILE] is checked for updates. */-    const val MANIFEST_URL = "https://data.maproj.org/planet4.manifest.json"+    const val MANIFEST_URL = MapTileCache.BASEMAP_MANIFEST_URL      /** Pinned manifest filename (under [OVERLAY_ROOT]). */     const val MANIFEST_FILE = "manifest.json"
maps/src/main/java/com/vayunmathur/maps/util/MapOverlayWorker.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/util/MapOverlayWorker.kt b/maps/src/main/java/com/vayunmathur/maps/util/MapOverlayWorker.ktindex a1b46dba47..62ac25cec5 100644--- a/maps/src/main/java/com/vayunmathur/maps/util/MapOverlayWorker.kt+++ b/maps/src/main/java/com/vayunmathur/maps/util/MapOverlayWorker.kt@@ -24,7 +24,7 @@ import java.util.concurrent.TimeUnit /**  * Checks for and fetches incremental map updates (Phase 2: download + store).  *- * One run: fetch `planet4.manifest.json` (kilobytes, any network), compare+ * One run: fetch `planet5.manifest.json` (kilobytes, any network), compare  * its overlay sequence against the pinned manifest, and โ€” when newer โ€”  * download the missing segments sequentially through the shared  * [downloadModels] path (`.part` + Range resume, per-segment SHA-256, atomic
maps/src/main/java/com/vayunmathur/maps/util/MapTileCache.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/util/MapTileCache.kt b/maps/src/main/java/com/vayunmathur/maps/util/MapTileCache.ktindex 127b8f9540..be7a2f9c1d 100644--- a/maps/src/main/java/com/vayunmathur/maps/util/MapTileCache.kt+++ b/maps/src/main/java/com/vayunmathur/maps/util/MapTileCache.kt@@ -17,13 +17,24 @@ object MapTileCache {      */     const val BASEMAP_ARCHIVE_FILE = "basemap.mamaps" -    /** Where [BASEMAP_ARCHIVE_FILE] is fetched from on a first launch that has no copy yet. */+    /**+     * Where [BASEMAP_ARCHIVE_FILE] is fetched from on a first launch that has no copy yet.+     *+     * planet5: the dictionary-compressed format (v10 header). Installs that already hold a+     * planet4 base keep reading it (the reader speaks both) until the planet5 manifest's+     * rebase signal swaps it (see [BASEMAP_MANIFEST_URL]); older app versions keep fetching+     * planet4, which stays published unchanged.+     */     const val BASEMAP_ARCHIVE_URL =-        "https://data.maproj.org/planet4.mamaps"+        "https://data.maproj.org/planet5.mamaps" -    /** Where the incremental-update manifest lives (see `util/MapOverlay`). */+    /**+     * Where the incremental-update manifest lives (see `util/MapOverlay`). planet5's manifest+     * pins the planet5 base with an empty overlay list, which is the rebase signal: an install+     * on planet4 downloads planet5 once (on an unmetered network) and swaps it in.+     */     const val BASEMAP_MANIFEST_URL =-        "https://data.maproj.org/planet4.manifest.json"+        "https://data.maproj.org/planet5.manifest.json"      /**      * The single source of truth for the streamed basemap PMTiles URL.