mirror of
https://github.com/Dasemu/NavFrame.git
synced 2026-11-26 15:26:05 +00:00
Initial public NavFrame release with global regional package pipeline
This commit is contained in:
commit
d863f2b940
143 files changed
+17906
No files matched your search
@@ -0,0 +1,79 @@
|
||||
# Worldwide offline package pipeline
|
||||
|
||||
The app installs individual `.navframe` packages containing a PMTiles map, a SQLite POI/camera database and a manifest with source timestamp, coverage, attribution and SHA-256 hashes. Worldwide means regions discoverable in the official Geofabrik index, with publication on demand. It does not mean every region has already been generated or that OSM has complete camera data.
|
||||
|
||||
## Generate and publish
|
||||
|
||||
In `Dasemu/NavFrame`, open **Actions → Build worldwide offline regions → Run workflow**. Enter Geofabrik IDs such as `andorra,act,cantabria,us/california`. First run with **publish = false** to inspect artifacts; run with **publish = true** to publish packages. Each run builds at most 32 independent regions, with two concurrent builders and a 330-minute timeout per builder. No planet download or full-world local build is performed.
|
||||
|
||||
One-time bootstrap with SSH push access (no local GitHub CLI/token required): after pushing the project to the default branch, create and push the exact tag below. Only this tag triggers an automatic **Andorra** build with publication enabled; other tag or branch pushes do not trigger the offline builder. The catalog becomes available after that workflow succeeds.
|
||||
|
||||
```sh
|
||||
git tag offline-bootstrap-andorra
|
||||
git push origin offline-bootstrap-andorra
|
||||
```
|
||||
|
||||
Discover valid IDs without downloading extracts:
|
||||
|
||||
```sh
|
||||
python3 tools/offline/global-regions.py discover --output build/offline/worldwide-sources.json
|
||||
```
|
||||
|
||||
The discovery output describes source availability. The app catalog contains only successfully built packages. Standard hosted runners accept extracts up to 1 GiB and packages below 500 MiB, consistent with the app's archive budget. Choose smaller Geofabrik subregions when an extract exceeds the budget; a future dedicated larger runner can increase the input budget, but the package must remain within the Android installer limit. Input budgets do not guarantee that a runner has enough memory or disk for every extract.
|
||||
|
||||
Local build (Python dependencies and Java 21 required):
|
||||
|
||||
```sh
|
||||
pip install -r tools/offline/poi-requirements.txt
|
||||
curl --fail --location --output planetiler.jar https://github.com/onthegomap/planetiler/releases/download/v0.10.2/planetiler.jar
|
||||
python3 tools/offline/global-regions.py build --region andorra --version 20260930.1 --planetiler-jar planetiler.jar --output build/offline/andorra
|
||||
```
|
||||
|
||||
`build-region.py` also accepts existing PBF/.poly/PMTiles inputs for network-free builds. Planetiler and POI dependencies are pinned by version. Build provenance records the recipe, upstream PBF SHA-256, coverage SHA-256, Planetiler binary SHA-256 and PBF replication timestamp. Geofabrik's `latest` source URL rotates daily; the downloaded PBF is checked against its official MD5 sidecar, and its actual bytes are identified by SHA-256. A daily rotation during download fails rather than accepting a mismatch. OSM's replication timestamp identifies data freshness, while the package version identifies a publication.
|
||||
|
||||
## Catalog and publication contract
|
||||
|
||||
Every package publishes a release `offline-gf-REGION-RUNID.ATTEMPT` with the package and `regional-catalog.json`. The workflow creates a draft, uploads assets, then publishes it; it never replaces package assets. Published region releases should be treated as immutable. Package manifests retain schema version 1 and stable IDs `gf-REGION` (slashes in upstream IDs become hyphens, e.g. `us/california` → `gf-us-california`).
|
||||
|
||||
The serialized catalog job reads **all** published region releases, merges their fragments and selects the latest publication per region. The merged index uses compact JSON and is checked against a 32 MiB / 4,096-entry Android discovery budget before publication.
|
||||
|
||||
The mutable discovery index is:
|
||||
|
||||
`https://github.com/Dasemu/NavFrame/releases/download/offline-catalog/regional-catalog.json`
|
||||
|
||||
This index release must remain mutable so its asset can be updated; do not enable repository-wide release immutability without moving the index to another host. The individual package URLs remain versioned. Historical package releases remain available. Catalog rebuilding is safe across concurrent region batches because the index job is serialized. A failed region does not prevent catalog rebuilding for successful releases.
|
||||
|
||||
Catalog format:
|
||||
|
||||
```json
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"regions": [{
|
||||
"manifest": {"id": "gf-andorra", "name": "Andorra", "version": "12345.1"},
|
||||
"archive": {
|
||||
"path": "gf-andorra-12345.1.navframe",
|
||||
"url": "https://github.com/Dasemu/NavFrame/releases/download/offline-gf-andorra-12345.1/gf-andorra-12345.1.navframe",
|
||||
"bytes": 123456,
|
||||
"sha256": "64 lowercase hexadecimal characters"
|
||||
},
|
||||
"countryCode": "AD",
|
||||
"country": "Andorra",
|
||||
"region": "andorra",
|
||||
"cameraCount": 4
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
The example abbreviates the manifest: real entries include the full map/POI hashes, geographic bounds and Polygon/MultiPolygon coverage. Metadata is optional; multi-country extracts may have no country code. Downloaders use `archive.url` when present and verify archive length/hash before installation. `path` remains a flat filename for older local catalogs. `global-regions.py merge` rejects conflicting entries for the same immutable ID/version.
|
||||
|
||||
## Coverage and cameras
|
||||
|
||||
Geofabrik `.poly` parsing preserves multiple islands and holes. Camera extraction accepts globally used `highway=speed_camera` nodes and explicitly speed-enforcing traffic-surveillance camera nodes. Generic CCTV, speed displays and abandoned objects are excluded. Raw direction evidence is retained without inventing enforcement direction. Average-speed relations, mobile enforcement and untagged cameras are not inferred. Missing camera entries cannot be interpreted as an absence of enforcement.
|
||||
|
||||
Maps use the existing NavFrame schema and bundled fonts. Worldwide coordinates and extraction support do not guarantee complete typography for every writing system; the existing limited offline glyph bundle remains a rendering limitation.
|
||||
|
||||
All package manifests retain **© OpenStreetMap contributors** and **ODbL-1.0**, with Geofabrik provenance. Keep attribution visible in the app and when redistributing packages. Generated large data assets belong in Releases/artifacts, not Git history.
|
||||
|
||||
## Verified upstream constraints
|
||||
|
||||
Geofabrik documents its [machine-readable worldwide index](https://download.geofabrik.de/technical.html). GitHub allows [up to 1,000 release assets, each under 2 GiB](https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases). Actions has [matrix/runtime limits](https://docs.github.com/en/actions/reference/limits); this workflow deliberately uses smaller batches and packages. Artifact storage is temporary and may consume account quotas; only preview runs upload package artifacts, while publication runs distribute packages directly through Releases.
|
||||
Reference in new issue
Block a user