OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
Standalone Cesium map experiment

Waze branch integration

feature/waze-live-map includes the navigation-cesium work. The shared Views selector switches between the ORC map, native Waze, and Cesium terrain; Places and the business ordering card stay shared. Cesium's camera drawer includes its Layers and Terrain pages, while Waze retains its own scoped gesture controls. Route and POI overlays feed Cesium through the existing map request contracts. A retained POI selection survives navigation remounts for both map renderers.

Host-location settings retain compact consent-window reuse and Android delivery status, with the Cesium branch's explicit location-service restart action added. A map-renderer failure still shows the Map unavailable overlay and Retry action.

After updating the branch, verify on the target device: switch through all three views, search/select an ordering POI in both map renderers, leave and return to Waze, and exercise terrain layers and host-location recovery. CI covers portable contracts; embedded Android and WebGL behavior still needs device verification.

Branch: navigation-cesium. Tracking: MAR-22.

Stage one checked the renderer without changing ORC navigation. The current viewer renders a local reference globe and destination marker. Early synthetic global and 250-metre diagnostic grids were removed once real imagery, borders, terrain cues, and navigation overlays supplied the necessary orientation. These reference graphics are not real streets or buildings. Without an installed imagery pack it has no aerial imagery. An optional terrain pack adds relative relief. Installed map packs can provide buildings, roads, and places. The embedded viewer consumes the existing navigation service's active route and guidance state to draw the route, destination, and current maneuver, and it can follow live GPS. Zoom, rotation/pan gestures, north-up, tilt, and reset are available. The viewer is an owned, isolated Chromium app window; Return to ORC, window close, or Ctrl+C stops only this experiment and its local server.

Architecture

  • ui/navigation/cesium_viewer_state.py: immutable destination and initial camera state in SI units. Independent of Cesium, Chromium, HTTP, and controllers.
  • frontends/web/cesium/: presentation. Maps the snapshot into Cesium camera and entity calls; emits an explicit close request. No dataset downloads or vehicle subscriptions. No runtime CDN, ion token, geocoder, or default hosted basemap.
  • apps/launchers/cesium_viewer_server.py: loopback HTTP adapter with separate web and SDK mounts. Owns serving and the close-request event, not browser lifetime.
  • apps/launchers/component_test/cesium_viewer_cli.py: composition and lifetime. Binds state, local server, native browser, unique temporary profile, and cleanup. Reuses ORC's existing GPU environment selection without forcing ANGLE flags.
  • apps/launchers/cesium_sdk.py: pinned SDK identity and local installation path. The optional SDK is installed explicitly outside the repository, not during ORC startup. Installer verifies npm archive SHA-512 and retains license files.

The prototype uses CesiumJS 1.124.0's prebuilt distribution (Apache-2.0). This is an explicit compatibility pin, not a claim to the latest release. Node/npm and a new Python dependency are not required on the phone. Upgrades require changing both the version and integrity pin, followed by device validation. Cesium data rights remain separate from its engine license.

Install and run on Termux/X11

From the repository root, with Termux/X11 and native Chromium available:

git fetch origin
git switch navigation-cesium
git pull --ff-only
python -m development.maps.install_cesium
python -m apps.launchers.component_test.cesium_viewer_cli --display :1

Installation requires internet once and stores the SDK under $XDG_DATA_HOME/openroadcode/cesium/1.124.0 (default ~/.local/share). It downloads roughly a few tens of MB; the SDK takes additional space unpacked. The base viewer then runs without internet. No Detroit data has been installed or claimed as available offline. --sdk selects another preinstalled SDK location.

Optional destination:

python -m apps.launchers.component_test.cesium_viewer_cli \
--latitude 42.3314 --longitude -83.0458 --label Detroit --distance-m 2500

The launcher prints its log path (cesium-viewer.log) and temporary local URL. It requests a maximized app window with a title-bar close button. Return to ORC closes the experiment; it does not start ORC if ORC was not running. If rendering fails, the return button remains available once configuration has loaded.

Device acceptance and next stages

Verify the globe renders, the Detroit marker is visible, gestures/buttons work, reset restores the initial view (Detroit centred, north facing, tilted), and closing/relaunching leaves no orphan browser or server. Try a second run without internet. Inspect smoothness while rotating and zooming; a blank local globe is only the rendering baseline, not a benchmark for an imagery/terrain/building scene.

The user runs the full quality gate: python scripts/quality_gate.py. Focused state/HTTP/lifecycle tests cover invalid destinations, asset isolation, authorized close requests, and cleanup on browser startup failure. A cloud Chromium software-rendering probe initialized Cesium and its controls, exercised reset, and confirmed the Return to ORC request reached the launcher. The user has confirmed the baseline quality gate passes and scrolling is smooth on Termux/X11. Use zoom to change camera height, tilt to switch between overhead and angled views, and reset after panning to restore Detroit.

Next, qualify and prepare a bounded Detroit imagery layer, then terrain and buildings independently using the dataset review. Keep data providers and coverage/license metadata outside the viewer's camera controls. Compare the same datasets in MapLibre before adding a permanent ORC launch control or replacing its navigation map.

First real imagery pack (bounded downtown Detroit)

The viewer can now load a separately installed local imagery pack. The pack's storage/checksum adapter is independent of the immutable SI layer snapshot and Cesium presentation. It serves only the selected image through the local origin; the browser never contacts the source service. Attribution stays in Cesium's credit display. Missing imagery leaves the reference globe usable.

From the repository root, download explicitly while online:

python -m development.maps.download_detroit_imagery
python -m apps.launchers.component_test.cesium_viewer_cli --display :1

The downloader queries the USGS NAIP-only catalog for primary Michigan records, retains the newest identifiable NAIP/USDA acquisition year in provenance, and uses the service's advertised newest-by-year mosaic to save a natural-colour WGS84 JPEG. It does not substitute partner or commercial imagery if no qualifying record is found. Completely black no-data exports are rejected before they enter the resumable cache. Source metadata is retained and the service must still describe public-domain imagery. USGS reference: https://imagery.nationalmap.gov/arcgis/rest/services/USGSNAIPImagery/ImageServer

Coverage is west/south/east/north -83.065, 42.315, -83.025, 42.345, approximately 3.3 km across around downtown Detroit. The export is 2,048 × 1,536 pixels; these are resampled output pixels, not a native acquisition-resolution claim. The actual year, records, downloaded byte count, and SHA-256 are recorded in manifest.json. The JPEG is capped at 20 MB; exact size and completeness need a successful device download. Inspect for no-data gaps near coverage edges/river. A bounded image is a first data-quality test, not a citywide tiled map.

Default installation: $XDG_DATA_HOME/openroadcode/map-packs/detroit-imagery-v1 (or ~/.local/share). The viewer automatically uses this pack if installed. Use --no-imagery to return to the reference globe, or --imagery /path/to/pack for an explicit pack. After installation the image works offline. Outside its rectangle the reference globe remains visible; the image is not stretched to cover the world. Terrain and buildings are still absent, so tilting the photo will not create 3D buildings.

The cloud network policy blocked the catalog and image-download endpoints. This change therefore does not claim a downloaded/visually verified Detroit image, confirmed acquisition year, exact file size, or measured device performance. Device download and visual inspection remain pending. Run the full quality gate locally after updating: python scripts/quality_gate.py.

Coarse Detroit terrain / relative relief

python -m development.maps.download_detroit_terrain
python -m apps.launchers.component_test.cesium_viewer_cli --display :1

The explicit downloader requests a 33 × 33 regular ground grid from USGS 3DEP's raw elevation service, with bilinear sampling and no hillshade rendering. Samples are roughly 100 metres apart over the same bounded Detroit rectangle. All 1,089 samples must be finite and present before the pack is installed. Raw responses, source metadata, source datum labels when returned, checksum, and coverage are retained outside the repository. No GDAL, raster-codec dependency, terrain service subscription, or runtime network request is introduced. Source: https://elevation.nationalmap.gov/arcgis/rest/services/3DEPElevation/ImageServer 3DEP data is public domain; rights reference is recorded in the manifest.

The viewer automatically loads an installed pack. --no-terrain compares with the flat ellipsoid; --terrain /path/to/pack selects explicit local data. Terrain and imagery remain independently installed layers. A Cesium adapter interpolates the local grid into bounded-detail heightmap tiles and stops refining at level 13. Reference graphics follow the sampled ground. Outside the pack it remains flat; the outer one-sample band fades to flat to avoid a hard vertical seam.

This is relative relief, not precise globe elevation. USGS ground elevation is not automatically Cesium ellipsoid height. Original source heights are retained, but the scene subtracts the central sample as its baseline; no silent NAVD88-to- ellipsoid conversion or arbitrary geoid offset is applied. Camera readout says "Scene height". Do not use these displayed values as navigation/altimetry readings. Datum conversion and production terrain tiling remain future work. The coarse sampling cannot reproduce buildings or fine roadside features, and Detroit's relief may look subtle. No exaggerated vertical scaling is applied.

After updating, download while online, inspect the printed source elevation range, then compare a tilted view with and without terrain. Check reset, zoom, reference graphics, imagery draping, and Return to ORC. Run the full gate locally: python scripts/quality_gate.py. Live USGS sampling and Termux rendering remain pending device validation; mocked tests do not verify real service coverage. A cloud software-rendering probe loaded synthetic terrain and imagery together, exercised zoom/tilt/reset, and confirmed close-request delivery. The optional Node test verifies north-to-south interpolation, coverage edges, and the detail limit; it skips in the quality gate when Node is not installed.

Offline Detroit buildings

On navigation-cesium, download once, then launch as usual:

python -m development.maps.download_detroit_buildings
python -m apps.launchers.component_test.cesium_viewer_cli --display :1

The installed pack is auto-detected. --no-buildings hides it; --buildings PATH selects another pack with the same validated format. No network requests are made by the building renderer. The source download uses four smaller Overpass queries, with up to three attempts per tile for transient errors. Completed tiles are cached beside the pack in a .download directory, so rerunning resumes after a timeout. No partial pack is installed. The public service can still be unavailable; retry later if all attempts fail. The downloader never silently installs an incomplete server response.

Coverage matches the Detroit imagery and terrain rectangle. This prototype uses OSM building ways and assembled multipolygon relations wholly inside that rectangle. Courtyards and building parts are preserved by the regional building pipeline; parts provide separate top and base heights, while containing whole-building outlines are not extruded over them. Boundary-crossing outlines remain omitted; this is not a complete city model. Flat roofs and bases are a visual approximation. Bases use the coarse terrain's relative relief at each outline's centroid.

Blue buildings use OSM height tags (unverified), gold uses building:levels × 3 m (an estimate), and brown uses a 9 m placeholder, not a measured height. Unsupported height units fall back to floor estimates or placeholders. The status line reports counts for each category. No facade textures or photogrammetry are included.

OSM data is licensed under ODbL 1.0, independently of CesiumJS. Visible contributor attribution links to https://www.openstreetmap.org/copyright. The external pack retains the source response and a manifest containing the download time, bounds, checksum, source, and license link. Keep those records with the data. Redistributing this derived database requires an ODbL review and compliance; it is not covered by the imagery's public-domain rights. Packs remain outside the code repository.

Layer comparison controls

The viewer now opens 1,500 m from the destination, with buildings visible. Highlighted buttons indicate visible layers. Buildings is disabled when no building pack is installed. The attribution remains visible when buildings are hidden. Reset view restores the camera, preserving layer choices; --distance-m overrides the initial viewing distance. The control rail scrolls on short screens.

Launch from an ORC POI

The selected-place popup now includes a separate 3D Map icon beside Navigate and Earth. It centers the local viewer on that POI, labeled with its name. The cyan destination point and its white-on-dark label bypass depth testing so buildings cannot hide them in a tilted view. Their position remains anchored to the selected POI at local ground height; this is a destination overlay, not a claim that the POI sits on a rooftop. The Google Earth button retains its ordinary online browser behavior. 3D Map works in offline mode, uses only installed SDK/data, and never downloads new coverage. If the selected place is outside installed imagery coverage, the viewer footer says so; missing data leaves the reference globe usable. Detailed coverage depends on the installed packs: the original downtown rectangle or the optional Downtown–Midtown tile pack. An absent SDK or invalid pack reports a launch failure in ORC; run the documented installers before using this action.

Return to ORC or the viewer window's close button closes the local viewer. ORC owns the isolated profile, browser and loopback server and cleans them up when the application exits. Only one local 3D viewer may run at a time. Close it before selecting another place. This stage is destination exploration, without live vehicle following, route overlays, or replacement of the normal MapLibre map.

Device validation: open a downtown Detroit POI in NAV, choose 3D Map, toggle Buildings and return. Repeat in offline mode, then select a POI outside the Detroit pack to confirm the coverage warning. Close ORC while a viewer is open and confirm its window also closes.

Downtown–Midtown tiled pack

Review the download plan first, then explicitly install:

git switch navigation-cesium
python -m development.maps.download_detroit_map_tiles
python -m development.maps.download_detroit_map_tiles --download
python -m apps.launchers.component_test.cesium_viewer_cli --display :1

The new pack covers approximately 5 × 6.7 km, from downtown north through Midtown (bounds: −83.085, 42.315, −83.025, 42.375). Eight geographic tiles each contain a 2048 × 1536 NAIP export and OSM building geometry. Export pixel count does not prove native source resolution, and the newest identifiable NAIP year can differ between tiles. NAIP remains public domain; OSM retains its separate ODbL license. Source responses and license references remain in the external pack.

Actual size is unknown before export. Hard payload caps are 160 MiB imagery, 160 MiB OSM source records, and 80 MiB prepared buildings, plus metadata. Most responses should be smaller; the installer prints the final size. Installation copies the completed download cache into the final pack, temporarily requiring roughly twice its storage. The .download directory remains for resume and can be removed manually after successful validation to reclaim duplicate storage. An incomplete download never replaces the original downtown packs or becomes an installed tile pack. Run the same command again to resume completed imagery and OSM requests. Transient OSM failures retry; imagery failures resume on rerun.

The viewer and POI action automatically prefer a validated installed tiled pack. The original packs remain usable with --no-tiles; explicitly choosing the old imagery/building options also bypasses automatic tiled-pack selection. No tile requests go to the internet during viewing: the loopback server serves only manifested image/geometry files. Source records are not exposed to the browser.

At most four nearby tiles are attached, with at most two tile loads in flight. The camera's visible rectangle selects intersecting tiles, prioritized by distance to its center. Camera movement unloads unwanted imagery and building entities. Late requests cannot attach to a closed viewer or an abandoned tile. At wide zoom levels this prototype deliberately limits detail to four nearby tiles; zoom in for full local detail. The footer reports active/installed tile counts and cyan outlines mark installed coverage. Buildings toggle independently; estimates and placeholders retain their colors. Boundary-crossing simple outlines belong to one tile by their mean vertex location; complex OSM relations remain omitted.

The shared builder now offers a separate Downtown–Midtown terrain pack, described below. Without it, the earlier downtown terrain prototype still fades to flat ground outside its rectangle. Embedding, live tracking, and routing overlays remain later stages.

Phone acceptance: pan from downtown north toward Midtown, watch active tile counts stay at four or fewer, and inspect newly loaded buildings/imagery. Toggle Buildings, zoom out, return to ORC, and repeat offline. Verify smoothness and memory use on the phone before considering broader coverage or embedding.

Shared builder and terminal install menu

Terrain can also be installed directly on Termux, without Docker or a map build host. It uses the same USGS downloader and stores device-owned data outside the certified navigation dataset:

git switch navigation-cesium
git pull --ff-only
bash development/termux/install_terrain.sh

Choose 2 — Downtown–Midtown and confirm. A complete pack is installed atomically; an existing validated pack is reused. Close and reopen the 3D viewer. Its footer reports the installed sample grid. If the image service returns a token-required error, the installer uses public USGS EPQS with a coarser 33×33 grid (about 200-metre spacing across Midtown). Two point queries run at a time; 1,089 queries can take several minutes. EPQS source responses are preserved, and an unspecified source datum is explicitly marked rather than assumed. No account/token is added or obtained. Device-installed Midtown terrain is preferred over the old downtown prototype; a deployed Midtown terrain pack takes precedence when both exist. This command downloads terrain only, reusing installed imagery/buildings. No navigation dataset publication or pull is needed.

The optional building stage now belongs to the existing map builder. It reuses navigation source PBFs rather than querying Overpass. See the map-builder workflow for coverage selection, publication, and --interactive vehicle installation. The 3d --layer terrain stage downloads a 65×65 USGS 3DEP elevation grid through the same validated publish/install workflow. Terrain installs independently of buildings, preserving sample responses and source datum metadata. It supplies relative relief, with roughly 100-metre sampling across Downtown–Midtown, not converted absolute ellipsoid elevations. Its payload is capped at 2 MiB; source provenance adds installation bytes shown in the pull menu. Empty/missing samples and mixed datums fail before installation; transient HTTP errors get bounded retries. Installed prototype aerial tiles with matching coverage are reused; the shared imagery build stage remains pending.

Acceptance: install the terrain pack using the map-builder instructions, reopen the 3D viewer, and check that its footer says relative relief. Inspect sloping ground with buildings on, toggle 2D/3D, and confirm the destination remains visible. Repeat offline. Detroit is fairly flat, so large mountains would indicate bad samples rather than successful terrain rendering.

Multi-resolution Metro Detroit terrain

The regional release pipeline builds terrain schema 3 as a bounded offline LOD pack. It contains a 33×33 Metro Detroit overview, sixteen 129×129 regional grids that become eligible at Cesium level 9, and 129×129 focus grids for Downtown–Midtown, Rochester, Southfield, and Pine Knob that become eligible at level 12. Cesium selects the most detailed eligible grid for each requested heightmap and stops refining at level 16. Vehicle, building, and POI placement use the best installed sample at their coordinate.

Schema-1 single grids and schema-2 mosaics remain readable. The source datum is still preserved as relative relief; this change does not claim ellipsoid-height conversion or navigation-grade altitude. All grids and original USGS response metadata remain offline after installation. The terrain artifact command reports tile count, LOD count, and compressed bytes and rejects archives above 64 MiB.

The optional Terrain cues control adds Cesium globe lighting, restrained 10-metre contours, and a locally generated contrast hillshade over installed imagery. It changes presentation only: source elevations and the selected 1×/2×/3×/4× relief scale are unchanged. Cues turn off while Ground is Flat and return to their prior selection when Relief is restored. They default off to avoid extra GPU work on constrained virtual and mobile GPUs. Contour presentation remains equivalent to a 10-metre source interval: Cesium uses 10/20/30/40-metre rendered spacing at 1×/2×/3×/4× so exaggeration does not create three times as many lines. Hillshade generation uses fourfold slope contrast to reveal Michigan's subtle relief, attaches no more than six visible tiles, and caches each generated image; it does not exaggerate the terrain mesh or require another data download. Contours use a translucent cool blue-gray rather than the road overlay's yellow/white hierarchy, so terrain shape and navigation geometry remain distinct.

Metro Detroit's schema-3 regional tier uses sixteen 129×129 grids, approximately 200 metres apart, while retaining its four finer focus grids. The separately triggered Build Michigan terrain shard workflow publishes a draft release for one bounded statewide package at a time. michigan-overview is an 8×8 set of 129×129 grids (roughly 600-metre sampling). Eight selectable peninsula shards use the same tile layout over smaller envelopes for approximately 200–300-metre sampling. Each release includes michigan-terrain-index.json; its rectangles are planning envelopes and include lakes plus some neighboring territory. Complete USGS response records are retained as deterministic gzip JSON so large statewide builds preserve provenance without exceeding the device's extracted- pack limit; elevation payloads remain ordinary validated JSON.

Install the statewide overview or the shard containing the intended destination with development.maps.install_terrain --coverage COVERAGE --pack-manifest URL --yes. The viewer composes installed Metro Detroit detail and the matching Michigan detail shard over the statewide overview. Terrain selection happens for each requested heightmap, so moving the camera outside Detroit falls back to statewide relief without reopening the viewer. Each Michigan build is independent. GitHub Actions builds the eight terrain rows as bounded matrix jobs, with no more than two rows running at once. Each row restores and saves its own validated .download tile cache, then passes successful tiles to a final assembly job through a seven-day workflow artifact. Rerunning a failed coverage therefore reuses completed rows instead of resampling them. Each row uses two concurrent tiles plus bounded exponential request backoff to reduce pressure on the public endpoint. Packaging and draft release creation still require all eight rows and every tile to pass validation; the temporary row artifacts are not the published map package. Building all nine packages is intentionally not one workflow job because USGS request time and release inspection remain explicit.

Metro Detroit uses the same resumable principle at individual-tile granularity. Its imagery package is preserved independently, while a matrix builds the 21 terrain grids with at most two USGS requests in flight. Each successful tile is cached and transferred as a seven-day workflow artifact. A final job assembles the unchanged schema-3 terrain layout only after every tile validates. A rerun therefore restores completed tiles instead of restarting a two-hour monolithic job, and an exact packaged-terrain cache bypasses the tile matrix entirely.

Pack descriptors carry separate imagery and terrain build fingerprints derived from coverage plus reviewed source/algorithm revisions. Before contacting USGS, the workflows restore an exact matching packaged artifact when one exists in the GitHub Actions cache. Metro Detroit also treats an existing requested release as reusable only after both archive names and descriptor fingerprints validate; stale or partial releases fail closed. The force_rebuild dispatch option bypasses artifact caches, requires a new Metro Detroit release tag, and is meant for source inspection rather than silently replacing an immutable cache entry. Changes to imagery sourcing, masking, dimensions, terrain tiling or schemas must bump the corresponding revision in development.maps.artifact_identity.

The same Michigan workflow builds a separately installable 8192×8192 USGS aerial image for the selected envelope. The statewide overview is intentionally broad background context; the eight smaller peninsula envelopes provide the useful regional tier, and existing Metro Detroit/focus imagery remains the most detailed layer. Imagery and terrain archives retain independent descriptors and checksums in one draft release. Runtime selection orders installed imagery broad-to-fine, so the smallest matching validated pack draws on top without stretching outside its declared rectangle. Each image remains under the runtime's 20 MiB payload limit; source export evidence is retained in its archive.

The Cesium presentation keeps rectangular imagery envelopes for useful cross-border context. Natural Earth 5.1.2 supplies compact worldwide country and disputed-boundary lines. Bundled Census geometry supplies internal boundaries shared by two U.S. states, while the country layer exclusively owns the national perimeter; this avoids competing independently simplified outlines. Michigan retains a cyan dashed outline for local emphasis. D.C. and territories are intentionally excluded from the state layer. Coordinates cross the toolkit-independent UI boundary in radians and the frontend clamps the lines to installed terrain. These are statistical boundaries, not survey-grade or navigation-authoritative borders. Shared state edges are deduplicated before they cross the UI contract so adjacent polygons do not brighten or disrupt the dash pattern. A locally rendered Natural Earth land mask gives the offline reference globe muted green land and blue ocean without contacting a hosted map service. Installed aerial imagery remains above that reference layer, and transparent NAIP coverage gaps reveal it instead of a black imagery-layer base. Neutral near-black JPEG padding is masked during regional assembly while dark colored source pixels remain visible. Boundary source: U.S. Census Bureau generalized ACS 2024 State_County States 20M layer, retrieved 2026-11-03: https://tigerweb.geo.census.gov/arcgis/rest/services/Generalized_ACS2024/State_County/MapServer/9 Natural Earth sources are public domain 1:110m Admin-0 countries and boundary lines, plus physical lake polygons, version 5.1.2. The offline reference globe draws the lake polygons back over its green land mask so the Great Lakes and other major inland waters remain blue.

After publishing a successful draft release, install both descriptors from the same tag and reopen the 3D viewer:

git switch navigation-cesium
python -m development.maps.install_region --coverage COVERAGE --pack-manifest "https://github.com/markisrt4/OpenRoadCode/releases/download/TAG/COVERAGE-imagery.zip.json" --yes
python -m development.maps.install_terrain --coverage COVERAGE --pack-manifest "https://github.com/markisrt4/OpenRoadCode/releases/download/TAG/COVERAGE-terrain.zip.json" --yes

Until the Michigan workflow file reaches the default branch, GitHub cannot dispatch that new filename directly. On navigation-cesium, use the already registered build-metro-detroit-imagery.yml dispatcher with a Michigan build_target; it calls the reusable Michigan workflow from the selected branch. Direct build-michigan-terrain.yml dispatch becomes available after merge.

Pine Knob relief comparison (Termux)

Pine Knob in Clarkston is coverage 3 in the optional terrain menu. Its separate pack preserves installed Detroit terrain. The viewer chooses a terrain pack containing the selected destination, preferring shared Midtown coverage where it matches. This experiment displays source elevations relative to the pack centre; it does not exaggerate heights or convert the source datum to ellipsoid heights.

git switch navigation-cesium
git pull --ff-only
bash development/termux/install_terrain.sh --coverage pine-knob
bash development/termux/test_pine_knob.sh

The test opens near the ski hill without Detroit imagery or buildings. Terrain ON/OFF switches between sampled ground and a flat ellipsoid without resetting the camera. With no imagery, 10 m contour lines help show the relief. The footer shows the sampled elevation range. Source sampling is coarse, so this is a terrain comparison rather than a detailed ski-trail map. The destination marker and building bases follow the selected relief scale and flatten with terrain disabled; building heights remain unchanged. Rendering and live USGS downloads require device validation. After downloading, this view works offline.

USGS HTTP 500, 502, 503, 504 and rate-limit failures receive up to three attempts per request. If the image service remains unavailable, the terrain installer switches to public EPQS; EPQS requests use the same bounded retries. A failure of both services leaves no incomplete pack installed. Rerun the terrain installer before opening the hill comparison; the local viewer URL alone does not indicate a successful terrain installation.

Pine Knob aerial imagery

Install the optional NAIP image directly on Termux, without Docker. This uses the same bounds as Pine Knob terrain and a separate device-owned pack. The downloader locks the newest identifiable NAIP acquisition returned for that coverage and retains source records, public-domain evidence, attribution and a checksum. The image is capped at 20 MiB; the exported 2048×1536 pixels do not imply native source resolution. Temporary HTTP failures get three attempts, with no partial pack installed on failure.

git switch navigation-cesium
git pull --ff-only
bash development/termux/install_pine_knob_imagery.sh
bash development/termux/test_pine_knob.sh

Close an existing viewer first. The Pine Knob launcher now loads its installed imagery over local terrain; imagery remains visible when Terrain is switched OFF. Contour lines are shown only when no imagery is loaded. Compare ON/OFF from the same camera angle, inspect coverage for no-data gaps, and reopen without internet to verify offline viewing. ORC's selected-POI adapter also selects this local image for destinations inside its bounds. No Pine Knob building pack is included.

Focused checks use mocked provider replies. Actual USGS download availability, Termux rendering and the full quality gate require user validation.

Imagery progress reports separate service metadata, source catalog, bounded export and JPEG download stages. On a network failure, the error identifies the stage and endpoint after bounded retries. This helps distinguish a service outage from an export request failure; retries cannot guarantee provider availability.

Touch-friendly camera pitch

More tilt and Less tilt orbit the ground at the current screen centre in 10-degree steps, preserving camera heading and distance. Tilt is limited to 0–80 degrees from top-down to keep the camera above ground. The footer reports the current tilt; Reset view restores the initial 45-degree view. These controls also work with terrain switched off, allowing a comparison from the same viewing angle.

Mouse panning changes the tilt anchor: tilt controls pick the visible terrain at the screen centre, falling back to the ellipsoid. If the centre points at sky, tilt changes orientation in place. Only Reset view returns to the selected POI. Pine Knob's test intentionally disables building layers; “buildings not installed” does not indicate a terrain failure. Ground relief is not vertically exaggerated.

Relief scale and pan arrows

The arrow pad pans across ground relative to the camera heading, retaining tilt and viewing distance. Each step is 15% of the current distance to the visible centre, bounded to 25 m–100 km. If the centre points at sky and no ground can be picked, pan waits until ground is visible. Mouse pan and touch tilt still work.

Relief cycles 1× / 2× / 3× / 4×; the default 1× uses actual relative elevations. The footer explicitly labels 2× through 4× as exaggerated. Source samples and the displayed sampled elevation range remain unchanged. Imagery drapes over the new terrain; markers and loaded building bases are refreshed, while building heights stay real. Terrain OFF disables the relief control and returns these overlays to flat ground. Reset view restores destination, initial tilt, and 1× relief. Contour spacing refers to displayed height, so exaggeration makes additional contour lines visible.

git switch navigation-cesium
git pull --ff-only
bash development/termux/test_pine_knob.sh

Pan away from the destination with the arrows, change tilt, then cycle relief. Check that panning and scaling retain the viewed area, imagery remains aligned, and the marker follows the ground. Reset should restore the destination and 1×. No pack downloads are required. Device rendering and the user-run quality gate remain pending.

Embedded ORC prototype (X11)

Navigation offers a Map / Terrain toggle on its existing toolbar. MapLibre remains the default; Google Earth is not an embedded platform in this selector. Selecting Terrain opens static exploration at the last selected POI, or the current known host/bridge position on first use (Detroit if unknown). Selecting a POI's existing local 3D action opens that place inside the map area rather than a separate browser window. Local packs and the installed Cesium SDK are reused; no map downloads are required.

The browser is still Chromium: this is an X11 surface-hosting experiment rather than a new embedded browser engine or dependency. Its blank app window is attached before navigating to the local Cesium page, avoiding reparenting a live WebGL canvas. Each session owns an isolated temporary profile, loopback origin and random loopback DevTools port. Startup and geometry updates run on a serialized worker. Generation checks cancel obsolete startup, and owned resources close before the transient map host is destroyed. Viewer failure restores MapLibre and shows a status. The browser and profile are recreated each time.

ORC's header and navigation sidebar remain visible. While Cesium is active, the native camera rail hides and Cesium's pan, pitch, zoom and relief controls are shown in the map area. The Map / Terrain toggle closes the browser and restores the native map. Leaving Navigation closes the session; re-entering Navigation starts on MapLibre. Route, radar and live vehicle-follow overlays still belong to MapLibre; the prototype is destination exploration.

git switch navigation-cesium
git pull --ff-only
python -m apps.orcUi

Chromium normally applies its GPU safety list. On a separately qualified VMware SVGA3D VM where chrome://gpu confirms hardware WebGL after bypassing that list, launch the opt-in hardware path with:

git switch navigation-cesium
OPENROAD_CESIUM_RENDERER=hardware-override ./runOrcUi

This passes --ignore-gpu-blocklist; it does not repair or certify the virtual GPU driver. Rendering corruption, context loss or GPU-process failure should be treated as a failed qualification. Use OPENROAD_CESIUM_RENDERER=software ./runOrcUi to return to the slower ANGLE SwiftShader fallback. With no variable, Chromium's normal safety decisions remain unchanged. Renderer selection, effective flags and the Chromium GPU report are recorded in cesium-stages.log.

On Termux/X11, open Navigation and toggle Map to Terrain, or search for Pine Knob and use its 3D action. Verify it stays inside the map area; pan, pitch and relief controls should respond while ORC sidebar navigation remains usable. Resize ORC, switch back using both return controls, then leave Navigation for Home and reopen it. Repeat a few times to check cleanup and resize behavior. Verify offline use after pack installation. If startup fails, copy the selector status and ${LOGGING_TMP_DIR:-${TMPDIR:-${XDG_CACHE_HOME:-$HOME/.cache}/openroadcode/tmp}}/cesium-embedded.log.

This uses existing Chromium, xdotool and xprop support. If the selector reports missing xdotool on Termux, install only these X11 tools:

git switch navigation-cesium
pkg install xdotool xorg-xprop

Focused mocked lifecycle, stale completion, return-to-native, cleanup and contract checks pass. Native X11 focus/touch, Termux GPU stability and device resizing are pending validation; this environment has no X11 test display. The full quality gate remains user-run:

git switch navigation-cesium
python scripts/quality_gate.py

Embedded Chromium launches with --no-first-run and --no-default-browser-check to avoid first-use dialogs for its temporary profile. Blank-window attachment and local-page loading have separate bounded startup deadlines; a page-load timeout reports the last DevTools startup stage or error. Actual Termux startup still requires device validation.

Embedded startup uses a script-free local HTTP loading page, not --app=about:blank. Some Chromium builds open a regular New Tab window for the latter. The local page creates a real app window without loading Cesium or creating a WebGL canvas; DevTools locates that exact page and navigates to Cesium only after attachment.

Compact embedded presentation

The Map / Terrain control shares the Home / Work / Places toolbar; there is no separate renderer-selection row or user-facing MapLibre label. It shows the current view and disables clicks while opening. Normal loading and failure messages use ORC's existing status area.

The embedded browser hides its duplicate header and starts with camera controls collapsed. Controls opens a compact four-column overlay for pan, zoom, pitch and relief; press Controls again to clear the map. A short relief/tilt readout replaces the multi-line data diagnostics. Renderer errors remain visible, and source attribution stays available in Cesium's credit area. Standalone viewing retains the fuller controls and diagnostics. Validate this layout on Termux by switching Map / Terrain and opening/closing Controls at the usual ORC window size.

Regional imagery installer

The device-side menu now starts with Metro Detroit overview and optional Detroit Downtown–Midtown detail, rather than the Pine Knob demo. Existing Pine Knob packs remain usable. This first regional step installs imagery only; base navigation/search/routing and OSM buildings still use the existing builder.

git switch navigation-cesium
python -m development.maps.install_region

The overview envelope is longitude −83.75 to −82.55, latitude 42.0 to 42.9: a rectangular planning area around Wayne, Oakland and Macomb, not certified county boundaries. A 2048×1536 image provides coarse context, not detailed imagery throughout the region. USGS catalog/export failures or source gaps remain possible. The menu prints the 20 MiB image cap before confirming; metadata adds disk usage. Viewing requires no network. The viewer chooses the smallest installed imagery coverage containing the selected destination. Reopen Terrain after installing.

git switch navigation-cesium
python -m development.maps.install_region --coverage metro-detroit --update

Updates fetch and validate a fresh revision before atomically switching a managed active link. Earlier revisions remain on disk for recovery. A failed update keeps the previous active pack. Metro Detroit overview downloads resume completed, checksum-checked pieces after interruption. Detail downloads remain available through download_detroit_map_tiles. This is an initial regional imagery workflow, not yet a regional terrain/building installer or an automatic imagery freshness check.

Large imagery catalog responses are fetched using the complete ArcGIS object-ID index, then checked batches of at most 20 records (subdivided if the service still truncates them or times out). Missing records stop installation before image export; source IDs and the assembled catalog remain in pack provenance.

During imagery transfer, the terminal displays downloaded MiB, total MiB and percentage when USGS provides a Content-Length header. Without that header it shows downloaded MiB and “total size unknown”; it does not guess a percentage. Catalog batches show records fetched and percentage separately. These indicators measure download progress, not final validation or installation completion.

Catalog record batches use a 30-second network timeout and two complete-response attempts before splitting into smaller requests. Retries include reading the response body, not only opening the connection. Single-record requests keep retrying temporary failures until successful or cancelled. Installed imagery stays active throughout.

The Metro Detroit overview uses 16 smaller 512×384 exports, combined locally into one north-first 2048×1536 JPEG using the already installed Pillow library. Each export queries only its own geographic footprint. Transfer is capped at 1.25 MiB per piece (20 MiB total), with up to another 20 MiB for the final image during assembly, plus source metadata. Individual pieces may use different NAIP acquisition years; per-piece catalog/export evidence is retained. Completed pieces remain in the .download cache if another export fails. A successful assembly removes that cache so later updates fetch fresh acquisitions.

Build once, distribute a checked imagery artifact

For regular device installation, prefer a prebuilt archive over on-demand USGS exports. GitHub Releases is the distribution channel for inspected Metro Detroit packs. A build machine must first finish and inspect the imagery; packaging does not repair USGS outages or certify that exported imagery has no gaps. The existing navigation dataset still uses its SSH/rsync deployment.

On the build machine (repository environment with Pillow, already supplied by ORC installers), build without activating the result on that machine:

git switch navigation-cesium
python -m development.maps.install_region --coverage metro-detroit --build-only build-output/metro-detroit-imagery
python -m tools.map_builder.builder.imagery_artifact --coverage metro-detroit --pack build-output/metro-detroit-imagery --output build-output/artifacts/metro-detroit-imagery.zip

Inspect the imagery before distributing it. Upload both metro-detroit-imagery.zip and metro-detroit-imagery.zip.json beside each other on an HTTPS server or as release assets. Packaging preserves the source records and evidence files. The descriptor includes the exact archive size and SHA256. These commands do not upload or publish anything automatically.

On Termux, substitute the actual published descriptor URL below:

git switch navigation-cesium
python -m development.maps.install_region --coverage metro-detroit --pack-manifest https://YOUR-HOST/metro-detroit-imagery.zip.json
./runOrcUi

The installer shows size before confirmation, saves partial transfers for HTTP Range resume, and restarts safely if the server ignores Range. It caps archives and extraction at 64 MiB, checks SHA256, rejects unsafe archive entries, validates imagery checksum and regional bounds, then switches the active revision. Existing imagery stays usable if transfer or validation fails. Add --update to replace an existing installation with a newly published artifact. Completed archives are retained in the device's .artifacts cache for reuse; this consumes extra space. The pack descriptor and archive must come from a trusted publisher: checksums verify transfer consistency, not publisher authenticity.

Build and retain versioned imagery on GitHub

The repository includes a manually triggered Build Metro Detroit imagery GitHub Actions workflow. Run it from the Actions page on the navigation-cesium branch. It downloads and validates the overview, packages the pack, uploads a 14-day workflow artifact for inspection, and creates a versioned draft GitHub Release. No separate runner or publishing secret is required; the workflow uses the repository's scoped GitHub token.

Download the workflow artifact and inspect the packaged image before publishing the draft release. Published release assets do not use the temporary Actions artifact retention period. Each run uses a new tag such as metro-detroit-imagery-20261013-run42, so previous known-good packs remain available for rollback. Do not reuse a tag or replace assets in a published version.

After publishing the draft, install the newest published pack on Termux:

git switch navigation-cesium
bash development/termux/install_metro_detroit_imagery.sh
./runOrcUi

The launcher selects the newest published, non-prerelease Metro Detroit imagery release. Add --update when replacing an already installed pack, or use --version metro-detroit-imagery-VERSION to install a specific revision for rollback. Pass --yes for a non-interactive install. Release assets remain available until the corresponding asset, release, or repository is deleted. The version-specific URL intentionally remains fixed; select a newer release explicitly when updating a device.

USGS source downloads now retry temporary network failures, timeouts, incomplete response reads, HTTP 429 and HTTP 500/502/503/504 until success or Ctrl+C. Backoff is 10, 20, 40, 80, then 120 seconds; a longer server Retry-After takes precedence. A visible one-second countdown remains interruptible. Catalog batches still split after two failed attempts; the smallest requests keep retrying. Fatal HTTP errors, invalid source rights and failed data validation still stop. Completed overview tiles remain cached on cancellation; the current unfinished JPEG restarts.

Regional envelopes can include areas with no approved US NAIP sources (for example, across the border or over water). If a complete catalog contains no NAIP/USDA source for an overview piece, the builder leaves that piece transparent and records its bounds and source evidence in missing_coverage. Such overviews use size-bounded WebP with alpha, with a coverage-gap count in the title. This avoids lossless PNG exceeding the viewer's 20 MiB image limit. It does not substitute partner imagery or invent ground detail. Undated identifiable NAIP, invalid rights, incomplete catalogs and network failures are not treated as coverage gaps. A region with no supported imagery at all still fails. Re-running reuses completed pieces, including checked gap records, until the pack is successfully assembled.

The optional Cesium road overlay limits detail to zoom 13 and covers the visible camera rectangle with at most six vector tiles, reducing zoom when necessary. Distance conditions progressively hide geometry by road class and hide road labels before statewide scale; motorway references remain visible farther out than primary and secondary labels. Roads and settlement names are separate controls; Places starts disabled, and its Cesium label entities are not created until enabled. Transportation-name placement paths supply labels but are never drawn as road geometry. Tile decoding admits drawable major-road geometry before local-road and label-placement paths so metadata cannot exhaust the bounded tile budget ahead of the roads themselves. This bounds entity and label work on virtual or embedded GPUs.

Inspect a locally built archive without hosting

Keep the archive and its adjacent .zip.json descriptor together. Install it without contacting USGS or any other network service:

git switch navigation-cesium
python -m development.maps.install_region --coverage metro-detroit --pack-file build-output/artifacts/metro-detroit-imagery.zip --update
./runOrcUi

The installer shows size and asks for confirmation, checks the descriptor's region, filename, size and SHA256, then extracts and validates the imagery before activation. --update allows replacing an existing managed imagery revision; the previous revision remains available. Reopen Terrain if ORC is already running. --pack-file, --pack-manifest, --github-release and --build-only are mutually exclusive.

Shared ORC camera rail and detail imagery

The existing ORC camera rail now operates Terrain through semantic exploration camera actions: pan, relative zoom, north, recenter and tilt/2D–3D. Recenter resumes following the vehicle when a live fix is available. The vehicle-follow button now operates Terrain; route guidance remains a later integration step. Changing tilt/2D–3D keeps the current panned ground centre. The native zoom number is replaced by a dash in Terrain, since its camera uses viewing distance instead. Standalone browser exploration retains its own camera buttons; the embedded Controls menu keeps dataset/layer controls rather than duplicating the ORC rail.

The rail stays in place across map switching, preserving embedded surface size. Startup waits for the initialized viewer's first rendered frame (up to 45 seconds) before reporting ready. This targets startup/layout flashing; it does not prove that every Termux/X11 GPU issue is fixed. Camera work runs on the existing runtime worker, ignores stale generations, and owns no browser transport in widgets.

Downtown–Midtown detail imagery is now a 4096×4096 composite built from 16 1024×1024 exports. It uses the same image payload cap and resumable tiles, with more decoding/GPU memory than the coarse Metro Detroit overview. Build into a new directory so older lower-resolution data is not mistaken for this revision:

git switch navigation-cesium
python -m development.maps.install_region --coverage detroit-midtown --build-only build-output/detroit-midtown-detail-v2
python -m tools.map_builder.builder.imagery_artifact --coverage detroit-midtown --pack build-output/detroit-midtown-detail-v2 --output build-output/artifacts/detroit-midtown-detail-v2.zip
python -m development.maps.install_region --coverage detroit-midtown --pack-file build-output/artifacts/detroit-midtown-detail-v2.zip --update
./runOrcUi

Open a place within Downtown–Midtown to inspect detail. The smallest installed imagery coverage containing that place is selected; outside it the metro overview remains available. Existing still-smaller legacy downtown coverage takes priority if installed. Source acquisitions and gaps determine actual visual quality; more output pixels do not create detail absent from NAIP itself.

Terrain startup cover and live vehicle following

ORC places a native sibling loading cover above the browser host before starting Terrain, keeps host geometry stable, and removes the cover after initialization, globe tile readiness, a rendered frame, and a 750 ms settling interval. Errors or cancellation release the browser and restore the normal map. This must still be checked on Termux/X11; it hides startup transitions rather than repairing driver faults that occur during use.

Terrain receives SI positions from the existing navigation camera runtime. Only uncached fixes with fix mode 2 or 3 are forwarded as live positions. No cached startup coordinates are labelled as a live vehicle. The latest position is coalesced on the existing worker at up to two updates per second; a visible vehicle marker remains available with Follow off. After ten seconds without a valid received fix, the marker hides and follow waits without moving the camera.

Press F to toggle vehicle follow; ◎ resumes it. Toolbar pan, north and tilt/2D–3D, and direct mouse/touch camera interaction pause following. Toolbar zoom preserves following. Camera distance, tilt and bearing are preserved as the vehicle moves; this first version follows position, not a changing course-up heading. Opening a selected POI starts exploration with follow off. If no live position is available, recenter returns to the exploration destination while waiting. Switching back to Map restores its previous follow-button state.

Follow now keeps installed regional imagery underneath installed detail layers. Detail textures are attached for intersecting views and released outside them; this uses only packs mounted when the viewer opens. Terrain packs still do not hot-swap, and no additional data is downloaded. Route guidance and radar still use the regular map.

git switch navigation-cesium
git pull --ff-only
python scripts/quality_gate.py
./runOrcUi

Check the startup cover, then test with the existing sensor bridge/position source connected: vehicle marker and following, pan to pause, F/◎ to resume, zoom while following, and switching back to Map. With no live fix, expect “Waiting for live vehicle position,” not a moving cached marker.

The default Terrain view omits the generic exploration marker and label. The camera still has an initial/reset centre; selected POI destination markers and the live vehicle marker remain visible through their respective state contracts.

Regional background with detail overlays

Embedded Terrain, selected-place exploration and the default standalone viewer now mount the known installed imagery packs as an immutable, bounded layer stack (maximum six). The broadest coverage forms the background; smaller footprints sit above it. The metro overview stays available when the view leaves a detail area. Transparent coverage gaps in detail reveal the background. A transparent global base prevents Cesium stretching bounded imagery across the globe.

Detail textures load only when their bounds intersect the camera view, checked at most twice per second, and are released when the view leaves. Pending loads cannot attach after close. Each image is checksum-checked before browser startup; source attribution and paths stay in their existing adapter boundaries. Reopen Terrain after installing another pack. Going outside all installed imagery still shows the reference globe; this does not invent coverage or use hosted layers.

Build and activate the higher-resolution Downtown–Midtown pack on Termux:

git switch navigation-cesium
git pull --ff-only
python -m development.maps.install_region --coverage detroit-midtown --build-only build-output/detroit-midtown-detail-v2
python -m tools.map_builder.builder.imagery_artifact --coverage detroit-midtown --pack build-output/detroit-midtown-detail-v2 --output build-output/artifacts/detroit-midtown-detail-v2.zip
python -m development.maps.install_region --coverage detroit-midtown --pack-file build-output/artifacts/detroit-midtown-detail-v2.zip --update
./runOrcUi

The detail output is 4096×4096 over the smaller downtown/Midtown footprint, compared with 2048×1536 across Metro Detroit. USGS source availability and native resolution still limit detail. Download retries and completed-piece resume remain in effect. Review quality and Termux GPU memory/performance before expanding high-resolution coverage. Route display/guidance is a subsequent integration step.

Rochester and Southfield test packs

Coverage presets now include Rochester test area (−83.175, 42.650 to −83.110, 42.705) and Central Southfield test area (−83.290, 42.440 to −83.220, 42.505). These are rectangular test envelopes, not full municipal boundaries. Imagery, terrain, and buildings remain separate optional layers.

On Termux, download buildings without requesting imagery again, then terrain:

git switch navigation-cesium
git pull --ff-only
python -m development.maps.download_detroit_map_tiles --coverage rochester --layer buildings --download
python -m development.maps.install_terrain --coverage rochester
python -m development.maps.download_detroit_map_tiles --coverage southfield --layer buildings --download
python -m development.maps.install_terrain --coverage southfield
./runOrcUi

The building adapter reuses the existing bounded eight-tile Overpass downloader: simple OSM ways only, with tagged heights, floor estimates, or placeholders. It retains source records and validates complete packs before installation. Per-pack caps are 160 MiB source plus 80 MiB geometry; staging duplicates cached data. Actual sizes depend on replies. Completed source tiles resume after failure; Overpass failures still have bounded retries. This is a device-side option; on a build host, the existing builder can instead extract either preset from Michigan PBF sources without live Overpass queries:

git switch navigation-cesium
bash tools/map_builder/scripts/run-builder.sh 3d --coverage rochester --layer buildings
bash tools/map_builder/scripts/run-builder.sh 3d --coverage southfield --layer buildings

Terrain uses the existing 65×65 USGS sample grid, with a 33×33 EPQS fallback; source datum is retained and the scene uses relative relief. Sampling does not capture every small hill, and incomplete terrain sampling may restart on retry. Real USGS/OSM responses still need testing on the device.

Select a place inside the desired area and open Terrain, or reopen Terrain while located there. Building and terrain packs are selected at viewer startup; they do not hot-swap during a drive between Rochester and Southfield.

Optional sharper imagery uses the same 4096×4096 build/package/install workflow. For example:

git switch navigation-cesium
python -m development.maps.install_region --coverage rochester --build-only build-output/rochester-detail-v1
python -m tools.map_builder.builder.imagery_artifact --coverage rochester --pack build-output/rochester-detail-v1 --output build-output/artifacts/rochester-detail-v1.zip
python -m development.maps.install_region --coverage rochester --pack-file build-output/artifacts/rochester-detail-v1.zip --update

Repeat with southfield replacing rochester. The six known imagery slots now include both suburban packs; lazy detail texture loading keeps the regional background available. Reopen Terrain after installing imagery.

Termux type-checker policy

If mypy is absent on Termux, the quality gate explicitly skips the strict type checker and its subprocess-dependent tests. Other checks continue. If mypy is installed, Termux runs it normally. Missing mypy still fails Linux/CI, and a regression test enforces that distinction; this is not a global optional gate.

Offline roads and place-name overlay

Terrain now reads the installed maps/vector/openroadcode.mbtiles for major road geometry, freeway references and city/town names. It reuses the builder's MVT parser with SI overlay contracts; no new provider, key, package, or download is needed. Roads & places in Controls toggles the overlay. If the offline vector map is absent/unreadable, the control is disabled and the globe remains usable.

Freeways use gold lines; other major roads use light lines. Freeway references and road/place names have outlined labels to remain readable above imagery and buildings. This is an orientation overlay, not route guidance. Residential/service roads and address labels are not included in this initial version.

The viewer requests at most nine tiles around the ground view centre, adapts zoom up to the installed dataset's maximum (capped at 14), and releases sources when moving away. Each tile is bounded to 500 road segments, 12,000 points and 60 place labels; road-name display is further limited. Reads use short-lived, read-only SQLite connections with a bounded 32-tile cache. Compressed tile size, coordinates and serving URLs are checked. Late responses cannot attach after close. Outside installed vector coverage, no road data is invented or fetched.

Embedded shutdown

The dedicated embedded Chromium process group now uses a one-second termination grace period, followed by the existing forced-termination fallback. It skips the interactive-window grace period and global matching-process scan for a live owned process. If a launcher wrapper has already exited, the existing profile- scoped cleanup remains as a fallback. Normal standalone browsers retain their previous shutdown behavior. Browser cleanup still precedes profile/server and native-host release; this is shorter bounded cleanup, not a guaranteed instant shutdown when a GPU/OS operation is stalled.

git switch navigation-cesium
git pull --ff-only
python scripts/quality_gate.py
./runOrcUi

On Termux, check road/freeway lines, place labels, the Roads & places toggle, panning/following across tile boundaries, and closing ORC with Terrain active. Actual WebGL appearance, road-overlay performance and shutdown latency still need device validation; cloud checks use synthetic MVT/SQLite fixtures.

Unified ORC map controls

The embedded Map and Terrain views now use one ORC-owned collapsible drawer with Cesium-inspired button grouping. Follow, recenter, north-up, 2D/3D, directional pan, zoom and tilt retain their existing semantic camera requests. Reset restores the initial Terrain view; in Map it uses the existing vehicle recenter behavior. Layers and Terrain options replace the camera page inside the same drawer. Each has a Back to controls button; no scrollbar or scrolling canvas is used. Compact windows use tighter spacing and smaller text, without changing the native map host's geometry or its window ID.

Terrain exposes imagery, buildings, roads, places, relief, height exaggeration, terrain cues and grid controls through immutable MapLayerControls snapshots. Unavailable layers are disabled. Those additional layer controls are disabled in regular Map mode until its renderer exposes corresponding capabilities. Imagery visibility also applies to subsequently streamed imagery, independently of terrain cues. Layer requests run on the existing serialized worker and discard stale generations; the Tk widgets never reach into browser/process objects.

Embedded Terrain no longer shows a second browser controls panel. The standalone viewer retains its browser panel. No extra WebGL context, render-loop work or source download was added. Native X11 stacking, touch, drawer sizing, page navigation and mode changes still require Termux device verification, as does GPU stability. The generated mockup was a styling reference, not a promise of new map imagery.

Installed imagery catalogs support up to 64 immutable pack entries. The viewer keeps at most six imagery layers resident (plus the reference globe): the broad background and up to five finest visible detail packs. It unloads unneeded textures before attaching replacements and limits concurrent imagery loads to six. Installing a seventh local pack no longer blocks Terrain startup.

Building streaming ranks the four nearby tiles around visible ground, using the same ground-anchor calculation as camera pan/tilt controls. If the center ray looks at sky, lower screen samples provide a visible-ground fallback. The center of the entire horizon-spanning rectangle is not a suitable local-detail anchor. Containing tiles rank ahead of neighboring tiles with closer centroids, including adaptive-size building cells. The four-active/two-pending limits remain unchanged. Distant geometry may still be excluded by this local-detail budget; this does not add statewide buildings or change height-tag/floor-estimate visibility rules.

Regional building presentation now includes approximate 9 m blocks at close zoom for footprints without height tags. These are labeled estimates, with a lazy 512-entity per-tile budget and four active tiles; see the state map build pipeline for zoom/distance limits. Schemas 1 and 2 remain readable alongside schema 3.

The bundled world-land/world-lake reference is independent of downloaded imagery and terrain. Turning Imagery off hides optional image layers but retains that world background (including the continental US); terrain cues remain separately controlled. The reference provider is explicitly tagged so late layer attachment also preserves visibility. This fixes a layer-control defect, but does not by itself establish the cause of every blank-region screenshot: center the US in the view and compare imagery on/off when checking device rendering. A source-geometry regression covers US interior points, Mexico, South America and open ocean using the actual bundled polygons.

The world reference is now a checked-in opaque 2048×1024 PNG (~31 KiB), generated from the same bundled Natural Earth land/lake polygons by development.maps.build_reference_globe in Actions. The viewer serves it locally at /data/world-reference.png; startup no longer rasterizes country paths or reads a canvas back through the Termux graphics stack. Polygon holes are applied per polygon, with independent multipolygon members. CI checks actual US interior, Lake Michigan and ocean pixels, and local PNG transport. Rebuild the asset in Actions when source polygons change. This removes the live canvas dependency; confirmation of the reported ocean-blue US still requires a Termux device test.

Offline overview imagery

The global reference now prefers the pinned SDK's existing NaturalEarthII TMS assets (Assets/Textures/NaturalEarthII, levels0–2). These provide low-resolution natural-color land cover/shaded relief, not detailed satellite photographs. All requests stay on the local SDK origin; no ion account or online imagery provider is introduced. The small opaque PNG remains a setup-failure fallback. Both paths use the protected reference-layer role and a single bottom imagery layer, so regional image layers stay above the world background.

The optional Terrain cues control is labelled Contours / shade, making its 10-metre contour lines distinct from terrain source-grid artifacts. Its state and defaults are unchanged. For visual checks use Height1× and turn this overlay off before judging seams in flat areas. Report rectangular gaps separately: source gaps, coarse mesh LOD and page boundaries need their own diagnosis, and are not established as fixed by the reference imagery change.

Political outlines in 2D Map mode

MapLibre's existing state-boundary layer now uses the bundled full 50-state Census polygons, including exterior coastlines and island outlines, rather than only shared internal edges. State outlines and Michigan emphasis are visible from zoom0 with a thin zoom-scaled line. The existing theme palette, local file sources, runtime style installer and road/route layer order remain unchanged. Restart ORC after updating the code to regenerate the installed style. This is a style-only deployment; rebuilding map tiles or downloading terrain is unnecessary.

Paged terrain seams and contour water masking

Each terrain callback now retains the metadata returned for its own geographic page. It does not sample whichever pages remain in the shared four-page LRU after concurrent requests complete. A small metadata halo includes adjacent grids at mesh edges. Exposed detail edges blend over at most two source samples into available coarser coverage (or the reference plane at a genuine coverage gap); shared same-resolution grid edges retain source heights. This is display blending, not a modification of archived elevation samples or a vertical-datum conversion.

Contours now compose Cesium's existing ElevationContour material with the bundled opaque world land/lake image and any provider water mask. Fragment positions are converted to geodetic-normal texture coordinates; ocean/lake pixels suppress contour alpha. The reference mask is coarse overview geometry, so exact shorelines remain approximate. This does not flatten water elevations or claim to correct all DEM source/datum discontinuities. VM/Termux full-tilt views remain acceptance checks after automated concurrency, edge-transition and material-contract tests.

Consistent height sampling across mesh levels

Further Keweenaw/full-tilt artifacts exposed a separate issue: source selection changed at mesh-level thresholds, allowing adjacent parent/child meshes to assign different heights to shared coordinates. Catalog-backed terrain now uses one canonical local sampler through the existing viewer server's /data/terrain-mesh/{z}/{x}/{y} route. It reuses installed baseline, national and Michigan grids and their validators; source priority depends on location and resolution, not the requesting mesh's zoom. Shared dyadic sample coordinates resolve the same height at every LOD. All meshes use one display reference; raw source elevations and files remain unchanged.

Spatial metadata buckets avoid scanning the full national catalog per sample. Parsed source grids and generated meshes are bounded to32 and8 entries; the browser retains8 unscaled33×33 meshes. Exaggeration is applied once on the browser side. Camera/marker height reads use the finest locally cached mesh, and startup preloads the destination mesh. The existing page/chunk path remains for legacy view states and auxiliary presentation, with its original budgets. This does not claim a resolution of source-datum differences or missing survey coverage.

Terrain mesh border and loading regression follow-up: source lookup includes a halo of two source samples, including adjoining Michigan root cells. Equal priority/resolution grids cross-fade only in that narrow border; their interior relief is retained. Missing coverage blends into a lower-priority source or the existing reference plane, and this remains relative relief rather than a datum conversion. Cesium mesh callbacks defer excess work with its supported undefined return (four requests maximum), instead of queuing unlimited local mesh jobs. Geometric error scales with height exaggeration, so 4× relief also refines its geometry. CI now renders a synthetic UP hill through the actual Python mesh endpoint and browser provider, and checks rendered peak/low elevations at 4×; this supplements source continuity tests and the lake contour pixel test. Actual Keweenaw source coverage and the user's VM/device view still need verification.

Shared navigation toolbar and touch drawers

Weather and Radar remain in the navigation toolbar beside Views, available while its drawer is closed. Views, Places, and Waze controls scroll by vertical drag or mouse wheel without a visible scrollbar. Dragging a card scrolls without selecting it; tapping still selects it. Termux Waze preflight errors now report the ADB connection failure or missing package instead of the generic Android-session hint.

The Views drawer only shows Close Waze while a retained Waze session is running; switching back to Road map does not hide the close action for that retained session.

Upgrading older Termux map data after the navigation merge

Map theme deployment copies the bundled global land, lakes, country and state reference GeoJSON into the installed data root before writing the updated style. An older regional pack therefore receives the new reference sources without a new vector-map download. Detailed regional roads still require their map packs.

Camera controls occupy a separate grid column beside the native map surface, matching Views/Places docking; they do not overlap its X11 input area. Cesium startup accepts a rendered frame while tiles continue loading, rather than waiting for every visible globe tile. Startup timeouts include the last page stage, with more detail in cesium-stages.log under the logging temporary folder.

First interactive frame and outline conventions

The embedded globe no longer waits for its initial nearby elevation mesh before wiring controls and accepting the first frame. Relief-dependent geometry refreshes when that mesh arrives; a detail-load error is reported while the globe remains usable. The default location remains Detroit only when composition has no current position. cesium-stages.log now timestamps imagery catalog, terrain catalog, buildings and dataset completion to distinguish disk loading from browser startup.

At overview zooms, Road map uses a solid Natural Earth coastline in addition to its dashed international borders. The international-boundary dataset excludes coastlines by design. These overview coastlines stop above zoom 8, where regional map data supplies detail. The Controls toggle remains visible as Hide Controls while its panel occupies the same dock column as Views and Places.

The shared map request wrapper forwards native presentation refresh requests as well as camera commands, retaining replay after drawer and platform changes.

Retained Terrain viewer during navigation

Switching Terrain → Road map now unmaps the owned Chromium child while retaining its browser, local server, loaded scene, and camera. Returning to Terrain in the same Navigation host maps that existing child without reparenting live WebGL. The native Road renderer is stopped before the Terrain window returns. Position, POI, and route snapshots are replayed on resume. A dead retained viewer falls back to a fresh launch, and a different explicit exploration destination starts a new scene rather than silently restoring the wrong place.

Leaving Navigation, opening an Android app through a host teardown, or closing ORC still closes the viewer and its server before destroying the host. This retention uses more memory while Road map is selected; only one Terrain viewer is retained. Optional imagery initializes asynchronously after camera controls are wired, allowing the reference globe to become usable while imagery loads. First launch still pays Chromium and dataset initialization costs; timings are recorded in cesium-stages.log as viewer-retained / viewer-resumed for switches.

Master integration after the November navigation merge

The Waze branch now incorporates master, reusing the shared map-tooling resolutions from navigation-cesium's master merge. The retained Terrain browser, progressive imagery startup, shared Views/Places controls, branded POI ordering and Android embedding remain enabled. Master calendar appointments, aircraft overlays, active media targets, and native structured renderer diagnostics are retained alongside those features. Device verification and the full quality gate remain required.