Skip to content

cli: grl-snam material-raster — segment satellite imagery into the material palette - #99

Merged
transfix merged 1 commit into
mainfrom
feat/material-raster-cli
Sep 27, 2026
Merged

transfix merged 1 commit into
mainfrom
feat/material-raster-cli

Conversation

@transfix

Copy link
Copy Markdown
Contributor

Promote the satellite→material segmenter (used to generate the Austin scene's material raster) into a first-class, reusable grl-snam command, so any scene's satellite orthophoto can be turned into the material input the nav-stats scorecard + drive need. A scene that carries no material data leaves grip mu=1 / mrisk=0 and the material_time_share buckets empty; this generates the raster that fixes that.

What

  • material_palette: GRIP_MU + TERRAIN_RISK (per-material dry grip + mobility risk) + grip_mu()/terrain_risk() accessors — the physical reading of the shared palette, keyed by id, so the segmenter and any consumer read one table. open_air (roads/pavement/developed hard ground) is the full-grip/no-risk surface; the risk-bearing ids are exactly RISK_MATERIAL_IDS.
  • grl_snam.tools.material_raster: classify / to_material_json / generate / from_bundle — a deterministic color/index land-cover classifier (excess-green vegetation, warm-tan soil, dark-blue water, bright warm-gray rock, else the neutral open_air surface), oriented to the sim grid (row 0 == world min_y, matching nav_samplers/sim_world occupancy — the orthophoto is north-up so it flips y). Writes cvc-scene-material/1 material.json. Reuses imageio (already a dep).
  • CLI: grl-snam material-raster BUNDLE (grid+bounds+image from terrain.json/satellite.png), or --satellite + --rows + --cols + --bounds for any other orthophoto; -o/--out, --preview.

Palette note: the segmenter never emits building materials — reinforced_concrete is a building-wall RF class (penetration-loss dB in MATERIAL_TABLE), not pavement, and buildings are obstacles tagged from scene metadata, so the ground classifier only emits open_air/foliage/soil/water/rock.

Tests

5 tests: classifier tagging + the y-flip, palette-sourced mu/risk in material.json, grip/risk defaults + RISK_MATERIAL_IDS consistency, generate+preview, from_bundle. Verified byte-identical to the prototype on the Austin bundle (open_air 58% / foliage 31% / soil 9% / water 1.3% / rock 0.6%).

Feeds the item-2 material-aware scoring chain: cvcdbg PR-2 (the Austin data) now comes from this command; the cvcdbg harness (PR-3a, #135) + demo3 load the material.json it writes.

…terial palette

Promote the ad-hoc satellite->material generator into a first-class, reusable grl-snam command so any
scene's satellite orthophoto can be turned into the material input the nav-stats scorecard + drive
need (otherwise the grip/material columns are all-zero because a scene carries no material data).

- material_palette: add GRIP_MU + TERRAIN_RISK (per-material dry grip mu + mobility risk) with
  grip_mu()/terrain_risk() accessors — the physical reading of the shared palette, keyed by id, so
  the segmenter and any consumer pull ONE table. open_air (roads/pavement/developed hard ground) is
  the full-grip / no-risk surface; the risk-bearing ids (mu<1) are exactly RISK_MATERIAL_IDS.
- grl_snam.tools.material_raster: classify(), to_material_json(), generate(), from_bundle() — a
  deterministic color/index land-cover classifier (excess-green vegetation, warm-tan soil, dark-blue
  water, bright warm-gray rock, else the neutral open_air surface), oriented to the sim grid (row 0 ==
  world min_y, matching nav_samplers/sim_world occupancy — the orthophoto is north-up so it flips y).
  Writes the cvc-scene-material/1 material.json (id grid + palette-sourced mu/risk). Reuses imageio
  (already a dep), not a new one. NOTE it never emits building materials: reinforced_concrete is a
  building-WALL RF class (not pavement), buildings are obstacles tagged from scene metadata.
- cli: `grl-snam material-raster BUNDLE` (grid+bounds+image from terrain.json/satellite.png) or
  `--satellite + --rows + --cols + --bounds` for any other orthophoto; -o/--out, --preview.

Tests (5): classifier tags + the y-flip, palette-sourced mu/risk in material.json, grip/risk defaults
+ RISK_MATERIAL_IDS consistency, generate + preview, from_bundle. Verified byte-identical to the
prototype on the Austin bundle (open_air 58% / foliage 31% / soil 9% / water 1.3% / rock 0.6%).
@transfix
transfix merged commit b5b5ce1 into main Sep 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant