2.0 KiB
Native Road Centre Lines Design
Architecture
The native compiler adds one independent polygon layer:
canonical bidirectional segment + trimmed OSM centreline
-> repeated 2m x 0.25m dash polygons
-> native-road/layers/center_lines.geojson
-> Workbench / native Blender adapter / Cesium
It does not read osm2streets center_lines.geojson. The legacy layer is a
visual baseline only.
Placement
- A candidate must have exactly forward and backward native roads for the same
segmentId, neither behighway=service, and have a valid trimmed OSM centreline. - Dashes use the legacy observed dimensions: 2m length, 0.25m width, with a deterministic 2m gap. The first dash starts at a fixed segment-local offset so rebuilds do not drift.
- The line is trimmed with the same
junctionPlanscutback used by native lane centreline generation. Any dash intersecting a crosswalk or stop line is omitted, preserving the control-marking priority already established. - One-way and service segments have no generated feature. A degenerate source line produces a diagnostic rather than malformed geometry.
Contracts
layers/center_lines.geojson is a Polygon FeatureCollection. Every feature
has native_id, segment_id, directional_road_ids, osm_way_ids,
dash_index, dash_length_m, dash_gap_m, placement_rule, and
provenance="native-road-center-line/v1".
compiled.json.layers.centerLines, comparison count
nativeCenterLineFeatures, and build-area.js required native records use the
same filename. catalog.NATIVE_ROAD_LAYERS maps source center_lines to the
existing center_lines material layer.
The Workbench loads this source into the marking overlay, exposes a Chinese
toggle, and identifies it as 道路中心虚线 on selection.
Compatibility
The change is additive within native-road/; --road-provider osm2streets
remains unaffected and is rollback. A native Blender build treats a missing
layer as an input error rather than silently omitting it.