Files
osmWorkflow/.trellis/tasks/08-17-native-road-center-line-styles/prd.md

2.9 KiB

Native road center line style overrides

Goal

Allow a Road Workbench user to select a generated native road centre line and persistently override its marking style, without turning the generated GeoJSON into the source of truth.

Confirmed Facts

  • Native center_lines.geojson currently contains automatic yellow dashed polygons (2m dash, 2m gap, 0.25m width), each tied to a segment_id.
  • A displayed dash can already be selected and exposes its segment provenance, but has no editing controls.
  • native-road-overrides.json is the persistent authority for existing road and connection edits. The Workbench already stages, validates, saves, then recompiles those overrides.
  • The generated layer is consumed by both Workbench and native Blender/Cesium; styling must therefore be compiled geometry and use the existing center_lines material path, not a Workbench-only display tint.

Requirements

  • R1: Selecting a centre-line dash must expose a Chinese style editor for its logical target and show the current effective style.
  • R2: Supported styles must include at least solid/dashed and white/yellow marking colours.
  • R3: Style choices must be stored in native-road-overrides.json, validated, reapplied during compilation, and survive a future Workbench launch.
  • R4: The regenerated GeoJSON must carry source traceability and effective style fields so Workbench, Blender and Cesium show the same marking.
  • R5: Default automatic centre lines remain unchanged for segments without an override; one-way/service exclusions and control-marking avoidance remain authoritative.

Initial Scope Boundary

  • Editing individual dash polygons is out of scope: they are derived pieces, not user-owned objects.
  • Per-segment control is recommended for the first version because current native segments already stop at junctions and have stable IDs.
  • Double-line semantics, legal overtaking inference, hand-drawn partial ranges, and changes to osm2streets output are out of scope unless explicitly accepted during planning.

Acceptance Criteria

  • A user can select a centre line, choose a supported style in Chinese, save it, regenerate, and see the result immediately in the Workbench.
  • After reload and recompilation, the selected segment retains its style while unedited segments retain the automatic yellow dashed default.
  • Native Blender/Cesium uses the same effective style and does not require osm2streets geometry.
  • Tests cover schema validation, style geometry, default fallback, persistence/API wiring, and Workbench selection/edit controls.

Key Decisions

  • The first version applies one override to the complete native segment between junctions. Individual dash and partial-range editing are deferred.
  • The initial style catalog is four explicit choices: yellow dashed, white dashed, yellow solid, and white solid. Double-line semantics are deferred.