# kit-mrt/lanelet2-josm-plugin architecture

> Architecture diagram of the GitHub repository kit-mrt/lanelet2-josm-plugin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kit-mrt/lanelet2-josm-plugin
- Repository: https://github.com/kit-mrt/lanelet2-josm-plugin

## Overview

This is a native JOSM plugin for editing Lanelet2 maps. The main workflow is to use JOSM menus, toolbars, and panels to inspect or modify map data, then apply changes through JOSM; optional workflows include launching a live 3D viewer and using a Python sidecar for selected maintenance actions. The graph preserves the README’s editing, regulatory, selection, maintenance, notes, and viewer capabilities. Connections for unsampled features are documented rather than inferred; source-level evidence is cited where available.

Main entry points: [`src/main/resources/lanelet2/viewer3d/static/app.js`](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/resources/lanelet2/viewer3d/static/app.js) (3D browser client), [`src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/internal/viewer3d/Viewer3dActions.kt`](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/internal/viewer3d/Viewer3dActions.kt) (Viewer launcher), [`src/main/resources/lanelet2/viewer3d/server.py`](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/resources/lanelet2/viewer3d/server.py) (Viewer server), [`src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/platform/LaneletSettings.kt`](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/platform/LaneletSettings.kt) (Settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_editing["Map editing"]
  node_lanelet_edit["Lanelet editing<br/>[EditActions.kt]"]
  node_regulatory["Regulatory tools"]
  node_selection["Selection tools"]
  node_autotag["Autotag hooks<br/>[AutotagHook.kt]"]
  node_zoom_filter["Zoom filter<br/>[ZoomFilterHook.kt]"]
  node_quick_tag["Quick tagging<br/>[QuickTagModal.kt]"]
end

subgraph group_support["Map support"]
  node_map_access["Lanelet access<br/>[Lanelet.kt]"]
  node_styles_presets["Styles and presets<br/>[MapStyles.kt]"]
  node_notes["Geolocated notes<br/>[NotesManager.kt]"]
  node_file_boundaries["File boundaries"]
  node_git_history["Git history tools"]
end

subgraph group_maintenance["Maintenance"]
  node_filter_broken["Broken-map filter<br/>[FilterBroken.kt]"]
  node_git_commit["Git commit helper<br/>[GitCommit.kt]"]
  node_routing_refresh["Routing refresh"]
  node_routing_graph["Debug routing graph"]
  node_sidecar["Python sidecar<br/>[BackendRunner.kt]"]
end

subgraph group_viewer["3D viewer"]
  node_viewer_launcher["Viewer launcher<br/>[Viewer3dActions.kt]"]
  node_viewer_bridge["Map bridge"]
  node_viewer_server["Viewer server<br/>[server.py]"]
  node_viewer_client["3D browser client<br/>[app.js]"]
  node_viewer_edit["Viewer editing<br/>[edit.js]"]
  node_viewer_sensors["Sensor scenes<br/>[scene.js]"]
  node_scene_server["Scene data server<br/>[__main__.py]"]
end

subgraph group_platform["Plugin platform"]
  node_plugin["Plugin startup<br/>[Lanelet2Plugin.kt]"]
  node_actions["Actions and menus<br/>[ActionRegistry.kt]"]
  node_settings[("Settings<br/>[LaneletSettings.kt]")]
end

node_josm_user(("JOSM user"))

node_josm_user -->|"starts JOSM"| node_plugin
node_plugin -.->|"installs menus"| node_actions
node_josm_user -->|"edits lanelets"| node_lanelet_edit
node_josm_user -->|"creates regulations"| node_regulatory
node_josm_user -->|"selects features"| node_selection
node_josm_user -->|"quick tags"| node_quick_tag
node_josm_user -->|"adds notes"| node_notes
node_josm_user -->|"chooses styles"| node_styles_presets
node_josm_user -->|"highlights boundaries"| node_file_boundaries
node_josm_user -->|"loads revision"| node_git_history
node_josm_user -->|"filters broken data"| node_filter_broken
node_josm_user -->|"commits file"| node_git_commit
node_settings -.->|"configures"| node_autotag
node_settings -.->|"configures"| node_zoom_filter
node_routing_refresh -->|"runs backend"| node_routing_graph
node_routing_graph -->|"runs script"| node_sidecar
node_josm_user -->|"opens viewer"| node_viewer_launcher
node_viewer_launcher -.->|"streams map"| node_viewer_bridge
node_viewer_launcher -->|"starts local server"| node_viewer_server
node_viewer_server -.->|"serves client"| node_viewer_client
node_viewer_client -->|"enables editing"| node_viewer_edit
node_viewer_edit -->|"sends commands"| node_viewer_server
node_viewer_client -->|"handles scene messages"| node_viewer_sensors
node_viewer_client -.->|"fetches sensor data"| node_scene_server
node_scene_server -.->|"serves scene data"| node_viewer_sensors

click node_plugin "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/Lanelet2Plugin.kt"
click node_actions "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/platform/ActionRegistry.kt"
click node_settings "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/platform/LaneletSettings.kt"
click node_lanelet_edit "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/edit/EditActions.kt"
click node_regulatory "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/regulatory/RegulatoryActions.kt"
click node_selection "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/selection/SelectionActions.kt"
click node_autotag "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/hooks/AutotagHook.kt"
click node_zoom_filter "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/hooks/ZoomFilterHook.kt"
click node_quick_tag "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/tools/QuickTagModal.kt"
click node_map_access "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/infra/Lanelet.kt"
click node_styles_presets "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/platform/MapStyles.kt"
click node_notes "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/notes/NotesManager.kt"
click node_file_boundaries "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/tools/HighlightFileBoundaries.kt"
click node_git_history "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/tools/GitHistoryLoader.kt"
click node_filter_broken "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/internal/FilterBroken.kt"
click node_git_commit "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/internal/GitCommit.kt"
click node_routing_refresh "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/hooks/RoutingRefreshHook.kt"
click node_routing_graph "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/dependent/DebugRoutingGraph.kt"
click node_sidecar "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/sidecar/BackendRunner.kt"
click node_viewer_launcher "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/internal/viewer3d/Viewer3dActions.kt"
click node_viewer_bridge "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/internal/viewer3d/Viewer3dDiffEngine.kt"
click node_viewer_server "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/resources/lanelet2/viewer3d/server.py"
click node_viewer_client "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/resources/lanelet2/viewer3d/static/app.js"
click node_viewer_edit "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/resources/lanelet2/viewer3d/static/js/edit.js"
click node_viewer_sensors "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/resources/lanelet2/viewer3d/static/js/sensors/scene.js"
click node_scene_server "https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/tools/scene_server/ll2_scene/__main__.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_lanelet_edit,node_regulatory,node_selection,node_autotag,node_zoom_filter,node_quick_tag,node_josm_user toneBlue
class node_map_access,node_styles_presets,node_notes,node_file_boundaries,node_git_history toneAmber
class node_filter_broken,node_git_commit,node_routing_refresh,node_routing_graph,node_sidecar toneMint
class node_viewer_launcher,node_viewer_bridge,node_viewer_server,node_viewer_client,node_viewer_edit,node_viewer_sensors,node_scene_server toneRose
class node_plugin,node_actions,node_settings toneIndigo
```

## Components

### Map editing

- [Lanelet editing](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/edit/EditActions.kt): `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/edit/EditActions.kt`
- [Regulatory tools](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/regulatory/RegulatoryActions.kt): `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/regulatory/RegulatoryActions.kt`
- [Selection tools](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/selection/SelectionActions.kt): `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/selection/SelectionActions.kt`
- [Autotag hooks](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/hooks/AutotagHook.kt): `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/hooks/AutotagHook.kt`
- [Zoom filter](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/hooks/ZoomFilterHook.kt): `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/hooks/ZoomFilterHook.kt`
- [Quick tagging](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/tools/QuickTagModal.kt): `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/tools/QuickTagModal.kt`

### Map support

- [Lanelet access](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/infra/Lanelet.kt): `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/infra/Lanelet.kt`
- [Styles and presets](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/platform/MapStyles.kt): `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/platform/MapStyles.kt`
- [Geolocated notes](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/notes/NotesManager.kt): `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/notes/NotesManager.kt`
- [File boundaries](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/tools/HighlightFileBoundaries.kt): `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/tools/HighlightFileBoundaries.kt`
- [Git history tools](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/tools/GitHistoryLoader.kt): `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/tools/GitHistoryLoader.kt`

### Maintenance

- [Broken-map filter](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/internal/FilterBroken.kt): `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/internal/FilterBroken.kt`
- [Git commit helper](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/internal/GitCommit.kt): `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/internal/GitCommit.kt`
- [Routing refresh](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/hooks/RoutingRefreshHook.kt): `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/hooks/RoutingRefreshHook.kt`
- [Debug routing graph](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/dependent/DebugRoutingGraph.kt): `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/dependent/DebugRoutingGraph.kt`
- [Python sidecar](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/sidecar/BackendRunner.kt): `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/sidecar/BackendRunner.kt`

### 3D viewer

- [Viewer launcher](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/internal/viewer3d/Viewer3dActions.kt): `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/internal/viewer3d/Viewer3dActions.kt`
- [Map bridge](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/internal/viewer3d/Viewer3dDiffEngine.kt): `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/internal/viewer3d/Viewer3dDiffEngine.kt`
- [Viewer server](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/resources/lanelet2/viewer3d/server.py): `src/main/resources/lanelet2/viewer3d/server.py`
- [3D browser client](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/resources/lanelet2/viewer3d/static/app.js): `src/main/resources/lanelet2/viewer3d/static/app.js`
- [Viewer editing](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/resources/lanelet2/viewer3d/static/js/edit.js): `src/main/resources/lanelet2/viewer3d/static/js/edit.js`
- [Sensor scenes](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/resources/lanelet2/viewer3d/static/js/sensors/scene.js): `src/main/resources/lanelet2/viewer3d/static/js/sensors/scene.js`
- [Scene data server](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/tools/scene_server/ll2_scene/__main__.py): `tools/scene_server/ll2_scene/__main__.py`

### Plugin platform

- [Plugin startup](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/Lanelet2Plugin.kt): `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/Lanelet2Plugin.kt`
- [Actions and menus](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/platform/ActionRegistry.kt): `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/platform/ActionRegistry.kt`
- [Settings](https://github.com/kit-mrt/lanelet2-josm-plugin/blob/main/src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/platform/LaneletSettings.kt): `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/platform/LaneletSettings.kt`

### Other components

- **JOSM user**

## Connections

- JOSM user → Plugin startup: starts JOSM
- Plugin startup → Actions and menus: installs menus
- JOSM user → Lanelet editing: edits lanelets
- JOSM user → Regulatory tools: creates regulations
- JOSM user → Selection tools: selects features
- JOSM user → Quick tagging: quick tags
- JOSM user → Geolocated notes: adds notes
- JOSM user → Styles and presets: chooses styles
- JOSM user → File boundaries: highlights boundaries
- JOSM user → Git history tools: loads revision
- JOSM user → Broken-map filter: filters broken data
- JOSM user → Git commit helper: commits file
- Settings → Autotag hooks: configures
- Settings → Zoom filter: configures
- Routing refresh → Debug routing graph: runs backend (evidence: `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/hooks/RoutingRefreshHook.kt`)
- Debug routing graph → Python sidecar: runs script (evidence: `src/main/kotlin/org/openstreetmap/josm/plugins/lanelet2/dependent/DebugRoutingGraph.kt`)
- JOSM user → Viewer launcher: opens viewer
- Viewer launcher → Map bridge: streams map
- Viewer launcher → Viewer server: starts local server
- Viewer server → 3D browser client: serves client
- 3D browser client → Viewer editing: enables editing (evidence: `src/main/resources/lanelet2/viewer3d/static/app.js`)
- Viewer editing → Viewer server: sends commands (evidence: `src/main/resources/lanelet2/viewer3d/static/js/edit.js`)
- 3D browser client → Sensor scenes: handles scene messages (evidence: `src/main/resources/lanelet2/viewer3d/static/app.js`)
- 3D browser client → Scene data server: fetches sensor data
- Scene data server → Sensor scenes: serves scene data
