feat(coverage): server-baked live RF coverage map#524
Merged
Conversation
- env shim wrote window.__env__, not globalThis.__env__ — all clutter layers were silently missing from every bake (sources was ["itm"]) - margin sampling was corner-registered vs the renderer's pixel-center grid (~100 m offset); shared sampler + tests - stable tile URLs + no-cache/ETag + hardlinked carry-forward replace ?v= busting (clients 304 instead of re-downloading the pyramid) - antimeridian: unwrapped bake frame, id-anchored bbox, seam-aware lookup - bake robustness: persistent worker pool, dead-thread respawn, outage guard w/ retries, painted-bounds state (v2, one-time full rebake), stateKey-prefixed bins, empty-mesh erasure, recency >24h, notify gating - dedupe: shared webMercator/tileFetchPool/gradient/CoverageMeta; drop dead liveCoverageRoles + reachKm; worker tsconfig for typechecking
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a server-baked live RF coverage map to MeshInfo. A dedicated
coverage-workercontainer continuously renders each mesh node's predicted coverage against real terrain
and land-cover, composites the results into map tile pyramids, and MeshInfo serves them
as a live map layer that refreshes as the mesh changes.
What it does
/v1/nodesand, for each positioned node, runs an ITM (Longley–Rice) coverage-margin render against Tilezen terrain (DEM) plus NLCD land-cover / ETH canopy / JRC
building clutter slices built per node.
(
output/coverage/{all,LongFast,MediumFast,…}, z5–z11), served at/tiles/coverage/{group}/….hover node-lookup card, and SSE-driven tile refresh (no reload).
300 km at a 3072 grid cap.
Additional Info
Bakes are incremental — a per-node margin cache re-renders only changed nodes, and a
streaming q8 compositor with write-through tile flush keeps worker memory ~flat regardless
of mesh size. Full bakes parallelize across N render workers.
Deployment
coverage-workerservice (Dockerfile.coverage: emscripten ITM + tsx worker), wiredinto
docker-compose.yml.config.toml.samplegains[coverage]; the worker is tuned viaCOVERAGE_*env(recency window, m/px, DEM size, worker count, recompute floor).
Validation
Validated on a 16-core dev box and capacity-tested on the small-VPS profile (3 vCPU / 4 GB):
cold bake of ~1,900 nodes completes with worker RAM ~1 GiB (flat), no OOM across multi-day
runs; incremental deltas sustain map refresh at a realistic recency window.
Areas touched
frontend/coverage-worker/(render + compositor), live-coverage UI underfrontend/src/pages/map/live/, terrain/clutter fetchers undermap/terrain/,api/api.pytile serving, plus deploy/config/docs. 52 files, +4.9k/−0.25k.