Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / scripts / networklocation / README.md
| 1 | # networklocation — offline database build scripts |
| 2 | |
| 3 | The three databases `:networklocation` reads are built here. None of them ships in the APK: |
| 4 | at 3.5 GB the old bundle pushed the MAOS factory zip past fastboot's 4 GiB limit, so they are |
| 5 | published to `data.maproj.org` and downloaded to device-protected storage on request. |
| 6 | |
| 7 | | Database | Built by | Holds | |
| 8 | | --- | --- | --- | |
| 9 | | `geocoder.db` | [`geodb_build/`](geodb_build/) | Addresses, named streets, POIs and populated places, from an OSM planet dump | |
| 10 | | `wifi-v3.wpsdb` | [`wps_harvest/`](wps_harvest/) | WiFi BSSID → coordinates + accuracy | |
| 11 | | `cells-v3.wpsdb` | [`wps_harvest/`](wps_harvest/) | Cell tower → coordinates + accuracy | |
| 12 | |
| 13 | Both are self-contained Rust crates with their own READMEs; start there. |
| 14 | |
| 15 | ## Rehearse before the planet |
| 16 | |
| 17 | Both builders scale from a metro extract to the planet, and both have surprises at scale that |
| 18 | a small extract will not show you. Work up the ladder, recording time and peak memory at each |
| 19 | rung, exactly as `scripts/maps/README.md` prescribes for the map layers: |
| 20 | |
| 21 | ``` |
| 22 | SanFrancisco.osm.pbf 31 MB seconds |
| 23 | california-latest 1.3 GB ~80 s, 9.0 M records, 70 MiB |
| 24 | planet-latest 90 GB hours |
| 25 | ``` |
| 26 | |
| 27 | ## What replaced what |
| 28 | |
| 29 | The geocoder used to be built by `osmium tags-filter | osmium export` into a **101 GB** |
| 30 | `addr.geojsonseq`, then packed by `scripts/geocoder_gen.cpp`. That needed osmium, g++, OpenMP, |
| 31 | simdjson and POSIX `mmap` — WSL only — plus ~190 GB of free disk and a large-RAM box, and it |
| 32 | indexed address points and nothing else. `geodb_build` reads the PBF natively through |
| 33 | `scripts/maps/osm_ingest`, holds no intermediate, runs on Windows, and also carries streets, |
| 34 | POIs and places. |
| 35 | |
| 36 | `scripts/geocoder_gen.cpp` is kept as the reference implementation of the v2 format. It is not |
| 37 | part of any current pipeline. |
| 38 | |
| 39 | The beacon stores used to be built by `wtfps-experiment/store.py`, which lived outside the repo |
| 40 | and no longer exists anywhere. `SUPPLY_CHAIN_RISKS.md` recorded that as the app's one |
| 41 | unresolved-provenance dependency: the shipped stores were built by code nobody could read. |
| 42 | `wps_harvest` is that code, in the tree. |
| 43 | |
| 44 | ## Removed |
| 45 | |
| 46 | `gen.sh`, `run-extract.sh`, `poll.sh`, `gpoll.sh`, `reencode.sh` and `memest.py` drove the old |
| 47 | JVM and C++ geocoder builds. They referenced `GeocoderGenerator` (a unit test that no longer |
| 48 | exists) and `networklocation/tools/extract-osm-addresses.sh` (a file that no longer exists), so |
| 49 | they could not run; and they hardcoded one machine's WSL paths. Recover them from git history |
| 50 | if the v2 format ever needs rebuilding. |