Files
road-compiler/.trellis/tasks/09-23-complex-junction-interior-line/design.md
T

1.7 KiB

Design

Boundary

The compiler must publish complex-junction white road markings only on the approach side of the first generated crosswalk or stop line. The central junction pavement and zebra crossing remain free of those markings.

Data Flow

  1. Complex junction templates produce approach lane preview lines and control polygons (crosswalks and stopLines).
  2. compileComplexLaneSeparators derives white lane-separator geometry from preview lanes. This is the layer shown by the screenshot.
  3. compileCenterLines derives center-line marking geometry from the trimmed bidirectional approach line.
  4. Both paths use trimLineBeforeFirstControl; complex lines must first be oriented from the exterior toward the cluster center, then restored to their published direction.

Implementation Shape

Reuse the existing center-aware trimLaneOutsideControls behavior (or extract its orientation step into a small shared helper) for complex preview and center lines. For complex lane separators, also trim against the stable published approach/core boundary so a control polygon that ends short of the core cannot leave an interior tail. Ordinary roads keep the existing behavior. All cutoffs remain driven by published geometry, with no cluster-specific coordinates.

Compatibility

  • Preserve feature identities, styles, source road IDs, and signal layers.
  • Do not change connector or lane-solving coordinates; only published marking geometry is clipped.
  • Ordinary-junction trimming remains unchanged.

Risks

If the first control polygon is malformed or absent, the existing full-line fallback remains in place. Tests must cover both line orientations so a future OSM way direction cannot reintroduce the bug.