Repository navigation
ARCHITECTURE
Lane Studio is a layer on iD. iD provides the editor (data graph, history, modes, OSM API, imagery, validator, sidebar, saving); Lane Studio adds a map layer drawing roads lane by lane, sidebar sections and fields that edit lane tags, tools, panes, a walkthrough and help pages. iD changes only through small hooks that keep its behaviour by default (Code map).
Two rules:
- The tags are the truth. Everything drawn is worked out from the data on every redraw. Lining lanes up, tapers, junction boxes and guide lines are drawing only; tags change only through edits, each one iD action and undo step.
-
Geometry is in metres, in a local frame (
metricFrame), converted to map coordinates only to draw.
| Folder | Holds |
|---|---|
model/ |
Pure functions: parseLanes reads lane tags into lanes per direction, serialiseLanes writes back only the keys that changed; lane types, markings, signs, connectivity, street features, street parking, speed limits, active traffic management |
actions/ |
iD actions for lane edits, markings, signs, copying and connecting lanes |
geometry/ |
Everything drawn, in metres: laneLayout, roadGeometry, streetGeometry, laneSymbols, parkingGeometry, parkingSpaceGeometry, railGeometry, railFeatures, signGeometry, routing.ts
|
svg/ |
The lanes layer (svgLanes) that runs the geometry and draws it, with click targets; vertices.ts
|
core/ |
State with d3 dispatch: selected lanes, tools, settings, the tools' modes (Routing, Speed Limit, Measure), brand logos, what's new, boot (laneStudioInit) |
osm/ |
Looking along roads: the corridor ahead, roundabouts |
ui/ |
Sidebar sections and fields, panes, panels, welcome screen, what's new, walkthrough, help pages |
validations/ |
The Lane tags rule |
Files by feature: Code map.
svgLanes redraws when the map moves or the graph changes:
- Collect the lane roads, carriageway areas, islands and street features in view.
-
roadGeometryworks out the roads: fitted into their carriageway areas; shifted and tapered at each join so lanes that carry on line up (alignAt,alignBranches,alignMerges, from connectivity relations orturn:lanes); junctions (junctionAt: through road, side roads, the box, flares, splits); road pieces (buildPieces: lanes, lines, arrows, labels, roadside strips); guide lines (junctionConnections); lanes channelled between islands. -
streetGeometry,signGeometry,laneSymbols, the railway and parking geometry use the same shifts. - Draw it all with click targets, then mark iD's own features for what was drawn (
markIdFeatures).
Work is skipped when nothing changed: at most one redraw a frame (drawWhenChanged), geometry kept while the graph
and view are the same, layouts cached per way version (cachedLayout), and attributes written only when they change
(attrChanged).
- Clicking a lane selects it in
laneState; the Lanes section edits the road's model andactionChangeLaneswrites it as one action. Tools (laneTools) change what a click does; Esc returns to Select. -
One menu with iD's: road fields are iD field types (
uiFields.lanes_*) and fields (lanes/*) placed in road presets byarrangeFields(common ones infields, the rest inmoreFields).field_filter.tsleaves out iD's field for a tag Lane Studio edits. Lane Studio's own sections build fields withfieldShellandlaneField, which make iD's markup. Every field's i button (fieldReference) shows_lanes.info.<topic>and a wiki link (fieldInfoPages); a test checks each has both.
-
Speed Limit (
lanes-speedmode):laneSpeedholds the measure and pick; the layer colours lanes byspeedClassOf; clicks writemaxspeedormaxspeed:lanes. -
Routing (
lanes-routingmode):vehicleRoutesexplores junction by junction with the drawing's junction rules, per vehicle profile, blocked by restrictions and limits. -
Measure (
lanes-measuremode): two clicks,geoSphericalDistance, and the road nearest the middle (roadAt) to set a width on.
uiIntroSetChapters gives iD's walkthrough Lane Studio's chapters (ui/intro.ts), and uiPaneHelpAddDocs puts
Lane Studio's pages first in the Help pane (ui/help.ts); their text is _lanes.intro and _lanes.help.
test/spec/lanes/: model, actions, geometry, routing, UI and the version rules. Geometry and routing tests build small
graphs in code or load fixtures from real data (test/spec/lanes/fixtures/).
Running locally · Code map · iD core · Customising · iD accessibility
Copied from docs/ on every change; edit the files there, not here.
Lane Studio
- Guide
- FAQ
-
Tag coverage
- Tags: Accessibility
- Tags: Addresses
- Tags: Advertising
- Tags: Aerialways
- Tags: Aeroways
- Tags: Agriculture
- Tags: Amenities
- Tags: Animals
- Tags: Annotations
- Tags: Barriers
- Tags: Bicycles
- Tags: Boundaries
- Tags: Bridges
- Tags: Buildings
- Tags: Buses
- Tags: Changeset
- Tags: Children
- Tags: Climbing
- Tags: Clubs
- Tags: Communications
- Tags: Crafts
- Tags: Crossings
- Tags: Cycleways
- Tags: Diplomacy
- Tags: Education
- Tags: Emergencies
- Tags: Ferries
- Tags: Food and beverages
- Tags: Government
- Tags: GPS
- Tags: Hazards
- Tags: Health
- Tags: Highways
- Tags: Hiking
- Tags: Historic
- Tags: Import
- Tags: Industrial
- Tags: Infrastructure
- Tags: Landcover
- Tags: Landuse
- Tags: Leisure
- Tags: Lifecycle
- Tags: Man made
- Tags: Marine
- Tags: Marine navigation
- Tags: Maritime
- Tags: Mechanics
- Tags: Military
- Tags: Motorcycles
- Tags: Names
- Tags: NaPTAN
- Tags: Natural
- Tags: Offices
- Tags: Parking
- Tags: Pipelines
- Tags: Places
- Tags: Police
- Tags: Power
- Tags: Products
- Tags: Properties
- Tags: Public transport
- Tags: Railways
- Tags: References
- Tags: Religion
- Tags: Restrictions
- Tags: Riding
- Tags: Routes
- Tags: Shops
- Tags: Social facilities
- Tags: Social networks
- Tags: Sports
- Tags: Swimming and bathing
- Tags: Tourism
- Tags: Transport
- Tags: Vending machines
- Tags: Waste processing
- Tags: Water
- Tags: Water management
- Tags: Waterways
- Tags: Other
- Developers
- API
- Contributing
- Releasing
- Accessibility
- Privacy
- Security
- Code of conduct
- Changelog