|
| 1 | +# Barriers |
| 2 | + |
| 3 | +## Visual Characteristics |
| 4 | + |
| 5 | +Barriers appear as linear features running across the landscape. Walls are thin, tall, and rigid. Hedges are wider, lower, and green. Retaining walls are squat and sturdy. City walls are massive stone structures. |
| 6 | + |
| 7 | +**Examples:** |
| 8 | +- Garden wall: 0.3m wide, 2m tall, beige (#c0b8b0) |
| 9 | +- Hedge: 1m wide, 1.5m tall, dark green (#4a7030) |
| 10 | +- City wall: 2m wide, 6m tall, stone (#c8c0b0) |
| 11 | +- Retaining wall: 0.5m wide, 1.5m tall, gray (#a8a098) |
| 12 | + |
| 13 | +## Data Sources |
| 14 | + |
| 15 | +Barriers identified by Overture fields: |
| 16 | +- `barrier=wall`, `city_wall`, `retaining_wall`, `fence`, `hedge`, `guardrail` |
| 17 | +- `height` tag (in meters) |
| 18 | +- `width` tag (in meters, defaults based on type) |
| 19 | +- `material` tag (brick, concrete, stone, wood, metal) — overrides type color |
| 20 | +- `colour` tag (explicit RGB override) |
| 21 | + |
| 22 | +## Rendering Strategy |
| 23 | + |
| 24 | +**Line Extrusion**: Each LineString segment is converted to a box mesh: |
| 25 | + |
| 26 | +1. For each consecutive pair of coordinates in the LineString: |
| 27 | + - Compute segment midpoint and length |
| 28 | + - Calculate rotation angle to align with path |
| 29 | + - Create `BoxGeometry(width, height, segmentLength)` |
| 30 | + - Position at midpoint with appropriate rotation |
| 31 | + - Sample elevation at midpoint |
| 32 | + |
| 33 | +2. **Rotation**: `rotation.y = -angle` where `angle = atan2(dx, dy)` aligns box along path |
| 34 | + |
| 35 | +## Geometry Details |
| 36 | + |
| 37 | +**Box Mesh per Segment:** |
| 38 | +- Dimensions: (width, height, length) |
| 39 | + - Width: configured per type or tag (0.3m wall, 1m hedge) |
| 40 | + - Height: configured per type or tag (2m wall, 1.5m hedge) |
| 41 | + - Length: segment length in Mercator coordinates |
| 42 | +- Material: `MeshLambertMaterial` with type or material-based color |
| 43 | +- Positioning: Centered at segment midpoint, terrain elevation + height/2 |
| 44 | + |
| 45 | +**Example (Garden Wall, 50m segment):** |
| 46 | +``` |
| 47 | +BoxGeometry(0.3, 2.0, 50) // 0.3m thick, 2m tall, 50m long |
| 48 | +Position: (midX, terrainY + 1.0, -midY) |
| 49 | +Rotation.y: -angleToAlignWithPath |
| 50 | +Color: #c0b8b0 |
| 51 | +``` |
| 52 | + |
| 53 | +## Configuration |
| 54 | + |
| 55 | +| Barrier Type | Default Width | Default Height | Default Color | |
| 56 | +|---|---|---|---| |
| 57 | +| wall | 0.3m | 2.0m | #c0b8b0 | |
| 58 | +| city_wall | 2.0m | 6.0m | #c8c0b0 | |
| 59 | +| retaining_wall | 0.5m | 1.5m | #a8a098 | |
| 60 | +| hedge | 1.0m | 1.5m | #4a7030 | |
| 61 | + |
| 62 | +**Material Color Overrides:** |
| 63 | +Same palette as buildings: brick (#c87060), concrete (#c8c4b8), stone (#b8b0a0), wood (#c8a878), metal (#888888), etc. |
| 64 | + |
| 65 | +## Elevation Handling |
| 66 | + |
| 67 | +- **Midpoint sampling**: Elevation sampled at segment midpoint |
| 68 | +- **Vertical positioning**: Height/2 above terrain, so base touches ground |
| 69 | +- **Slope following**: Each segment independently samples elevation, creating stepped appearance on steep terrain |
| 70 | +- **Precision**: Segments reconnect seamlessly across segment boundaries |
| 71 | + |
| 72 | +## See Also |
| 73 | + |
| 74 | +- **[Bridges](bridges.md)** — Linear elevated features |
| 75 | +- **[Structures](structures.md)** — Point-based objects |
| 76 | +- **[Systems](systems.md#spatial-organization)** — Coordinate system and spatial layout |
| 77 | +- **[Data Pipeline](../../data-pipeline.md)** — Feature extraction process |
0 commit comments