towerops/lib/towerops_web/live/coverage_live
Graham McIntire ce9bd744c7 feat(coverage): LOS/NLOS dual compute + buildings clutter + MS importer
Closes the cnHeat-parity gap on modes and clutter:

Backend
- Towerops.Coverages.Buildings.for_bbox/1 — PostGIS ST_Intersects
  query that returns each building polygon as a compact
  %{height_m, coords} map ready for in-memory point-in-polygon
  testing, so the per-pixel hot loop never round-trips to
  Postgres.
- Towerops.Coverages.Profile.sample/5 — accepts an optional
  :clutter list and adds the building rooftop height to terrain
  whenever a sample point falls inside a polygon. Pure ray-cast
  PIP for portability.
- Towerops.Workers.CoverageWorker — fetches buildings once per
  job and computes BOTH LOS and NLOS variants per SM-height
  tier (12 PNGs total). LOS passes clutter: [] (height-above-
  clutter view), NLOS passes the prefetched list (height-above-
  ground view with rooftop diffraction). Pixel-loop signature
  bundled into a ctx map to keep the function arity within
  Credo's max-8 limit.
- Towerops.Workers.MsBuildingsImportWorker — streams Microsoft
  GlobalMLBuildingFootprints GeoJSONSeq exports line-by-line,
  upserts into coverage_buildings in 500-row batches via
  insert_all + ON CONFLICT (source, ms_footprint_id). Handles
  Polygon and MultiPolygon geometries; stable-hashes the bbox
  when an explicit feature id is missing so re-imports are
  idempotent. Public import_file/2 lets ops drive a state at
  a time from IEx.
- Schema: nlos_tiers JSONB column on coverages, status_changeset
  whitelist, payload exposed via list_ready_for_organization.

Frontend
- LOS / NLOS toggle pills above the height slider (left panel).
  Selecting NLOS swaps each L.imageOverlay's URL via setUrl to
  the matching nlos_tiers PNG, drops the cached pixel data, and
  re-decodes for the RSSI filter; falls back to the other
  mode's tiers when one is empty so older coverages still
  render. coverage_hooks chunk: 22 KB → 25 KB.
2026-05-06 16:50:05 -05:00
..
form.ex fix(coverage): queue compute job after creating a coverage 2026-05-06 15:49:18 -05:00
form.html.heex feat: draggable Leaflet marker for radio location on coverage form 2026-05-06 14:57:55 -05:00
index.ex feat: add /coverage RF prediction feature scaffold 2026-05-06 13:44:14 -05:00
index.html.heex refactor: imperial coverage form + Deygout/curvature propagation 2026-05-06 14:44:23 -05:00
map.ex feat(coverage): LOS/NLOS dual compute + buildings clutter + MS importer 2026-05-06 16:50:05 -05:00
map.html.heex feat(coverage): LOS/NLOS dual compute + buildings clutter + MS importer 2026-05-06 16:50:05 -05:00
show.ex fix(coverage): production show-page crash and stale device on PubSub refresh 2026-05-06 15:19:32 -05:00
show.html.heex fix(coverage): production show-page crash and stale device on PubSub refresh 2026-05-06 15:19:32 -05:00