# strues-maps/qgis_osrm architecture

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

- Interactive diagram: https://gitdiagram.com/strues-maps/qgis_osrm
- Repository: https://github.com/strues-maps/qgis_osrm

## Overview

This is a QGIS plugin for requesting OSRM routing analyses and displaying or exporting results. Users start from a plugin action, choose a workflow and provider, supply map points or QGIS layers (or CSV input for batch routing), and receive map layers or a CSV. The graph preserves the documented route, matrix, isochrone, TSP, batch-routing, and provider-configuration capabilities. Some workflow internals were not sampled; edges are limited to shown references, excerpts, or README statements.

Main entry points: [`osrm_utils.py`](https://github.com/strues-maps/qgis_osrm/blob/main/osrm_utils.py) (Routing utilities), [`osrm_plugin.py`](https://github.com/strues-maps/qgis_osrm/blob/main/osrm_plugin.py) (Plugin actions), [`osrm_access_dialog.py`](https://github.com/strues-maps/qgis_osrm/blob/main/osrm_access_dialog.py) (Accessibility areas), [`template_osrm.py`](https://github.com/strues-maps/qgis_osrm/blob/main/template_osrm.py) (Dialog base)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Plugin entry"]
  node_plugin["Plugin actions<br/>[osrm_plugin.py]"]
end

subgraph group_workflows["Routing workflows"]
  node_route["Single route<br/>[osrm_dialog.py]"]
  node_matrix["Time matrix"]
  node_isochrone["Accessibility areas"]
  node_tsp["TSP solution<br/>[osrm_dialog_tsp.py]"]
  node_batch["Batch routes"]
  node_provider["Provider settings"]
end

subgraph group_shared["Shared services"]
  node_shared_dialog["Dialog base<br/>[template_osrm.py]"]
  node_geo_utils["Routing utilities<br/>[osrm_utils.py]"]
  node_polyfill["QGIS compatibility<br/>[osrm_polyfill.py]"]
  node_codec["Polyline decoder"]
end

subgraph group_platform["GIS and OSRM"]
  node_qgis["QGIS project"]
  node_osrm{{"OSRM service"}}
end

node_qgis_user(("QGIS user"))

node_qgis_user -->|"opens tools"| node_plugin
node_plugin -->|"opens dialog"| node_route
node_plugin -->|"opens dialog"| node_matrix
node_plugin -->|"opens dialog"| node_isochrone
node_plugin -->|"opens dialog"| node_tsp
node_plugin -->|"opens dialog"| node_batch
node_plugin -->|"opens dialog"| node_provider
node_route -->|"requests routes"| node_osrm
node_matrix -->|"requests matrix"| node_osrm
node_isochrone -->|"requests isochrones"| node_osrm
node_tsp -->|"requests solution"| node_osrm
node_batch -->|"requests routes"| node_osrm
node_route -->|"adds map layers"| node_qgis
node_matrix -->|"exports CSV"| node_qgis
node_isochrone -->|"adds layers"| node_qgis
node_tsp -->|"adds route layer"| node_qgis
node_batch -->|"adds route layer"| node_qgis
node_route -->|"inherits"| node_shared_dialog
node_matrix -->|"inherits"| node_shared_dialog
node_isochrone -->|"inherits"| node_shared_dialog
node_tsp -->|"inherits"| node_shared_dialog
node_batch -->|"inherits"| node_shared_dialog
node_provider -->|"inherits"| node_shared_dialog
node_route -->|"uses utilities"| node_geo_utils
node_matrix -->|"fetches table"| node_geo_utils
node_isochrone -->|"prepares access"| node_geo_utils
node_tsp -->|"uses utilities"| node_geo_utils
node_batch -->|"uses utilities"| node_geo_utils
node_provider -->|"uses utilities"| node_geo_utils
node_geo_utils -->|"decodes geometry"| node_codec
node_geo_utils -->|"uses compatibility"| node_polyfill
node_isochrone -->|"uses compatibility"| node_polyfill

click node_plugin "https://github.com/strues-maps/qgis_osrm/blob/main/osrm_plugin.py"
click node_route "https://github.com/strues-maps/qgis_osrm/blob/main/osrm_dialog.py"
click node_matrix "https://github.com/strues-maps/qgis_osrm/blob/main/osrm_table_dialog.py"
click node_isochrone "https://github.com/strues-maps/qgis_osrm/blob/main/osrm_access_dialog.py"
click node_tsp "https://github.com/strues-maps/qgis_osrm/blob/main/osrm_dialog_tsp.py"
click node_batch "https://github.com/strues-maps/qgis_osrm/blob/main/osrm_batch_route_dialog.py"
click node_provider "https://github.com/strues-maps/qgis_osrm/blob/main/osrm_provider_dialog.py"
click node_shared_dialog "https://github.com/strues-maps/qgis_osrm/blob/main/template_osrm.py"
click node_geo_utils "https://github.com/strues-maps/qgis_osrm/blob/main/osrm_utils.py"
click node_polyfill "https://github.com/strues-maps/qgis_osrm/blob/main/osrm_polyfill.py"
click node_codec "https://github.com/strues-maps/qgis_osrm/blob/main/osrm_utils_polylline_codec.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_plugin,node_qgis_user toneBlue
class node_route,node_matrix,node_isochrone,node_tsp,node_batch,node_provider toneAmber
class node_shared_dialog,node_geo_utils,node_polyfill,node_codec toneMint
class node_qgis,node_osrm toneRose
```

## Components

### Plugin entry

- [Plugin actions](https://github.com/strues-maps/qgis_osrm/blob/main/osrm_plugin.py): `osrm_plugin.py`

### Routing workflows

- [Single route](https://github.com/strues-maps/qgis_osrm/blob/main/osrm_dialog.py): `osrm_dialog.py`
- [Time matrix](https://github.com/strues-maps/qgis_osrm/blob/main/osrm_table_dialog.py): `osrm_table_dialog.py`
- [Accessibility areas](https://github.com/strues-maps/qgis_osrm/blob/main/osrm_access_dialog.py): `osrm_access_dialog.py`
- [TSP solution](https://github.com/strues-maps/qgis_osrm/blob/main/osrm_dialog_tsp.py): `osrm_dialog_tsp.py`
- [Batch routes](https://github.com/strues-maps/qgis_osrm/blob/main/osrm_batch_route_dialog.py): `osrm_batch_route_dialog.py`
- [Provider settings](https://github.com/strues-maps/qgis_osrm/blob/main/osrm_provider_dialog.py): `osrm_provider_dialog.py`

### Shared services

- [Dialog base](https://github.com/strues-maps/qgis_osrm/blob/main/template_osrm.py): `template_osrm.py`
- [Routing utilities](https://github.com/strues-maps/qgis_osrm/blob/main/osrm_utils.py): `osrm_utils.py`
- [QGIS compatibility](https://github.com/strues-maps/qgis_osrm/blob/main/osrm_polyfill.py): `osrm_polyfill.py`
- [Polyline decoder](https://github.com/strues-maps/qgis_osrm/blob/main/osrm_utils_polylline_codec.py): `osrm_utils_polylline_codec.py`

### GIS and OSRM

- **QGIS project**
- **OSRM service**

### Other components

- **QGIS user**

## Connections

- QGIS user → Plugin actions: opens tools (evidence: `osrm_plugin.py`)
- Plugin actions → Single route: opens dialog (evidence: `osrm_plugin.py`)
- Plugin actions → Time matrix: opens dialog (evidence: `osrm_plugin.py`)
- Plugin actions → Accessibility areas: opens dialog (evidence: `osrm_plugin.py`)
- Plugin actions → TSP solution: opens dialog (evidence: `osrm_plugin.py`)
- Plugin actions → Batch routes: opens dialog (evidence: `osrm_plugin.py`)
- Plugin actions → Provider settings: opens dialog (evidence: `osrm_plugin.py`)
- Single route → OSRM service: requests routes (evidence: `README.md`)
- Time matrix → OSRM service: requests matrix (evidence: `README.md`)
- Accessibility areas → OSRM service: requests isochrones (evidence: `README.md`)
- TSP solution → OSRM service: requests solution (evidence: `README.md`)
- Batch routes → OSRM service: requests routes (evidence: `README.md`)
- Single route → QGIS project: adds map layers (evidence: `osrm_dialog.py`)
- Time matrix → QGIS project: exports CSV (evidence: `osrm_table_dialog.py`)
- Accessibility areas → QGIS project: adds layers (evidence: `osrm_access_dialog.py`)
- TSP solution → QGIS project: adds route layer (evidence: `osrm_dialog_tsp.py`)
- Batch routes → QGIS project: adds route layer (evidence: `osrm_batch_route_dialog.py`)
- Single route → Dialog base: inherits (evidence: `osrm_dialog.py`)
- Time matrix → Dialog base: inherits (evidence: `osrm_table_dialog.py`)
- Accessibility areas → Dialog base: inherits (evidence: `osrm_access_dialog.py`)
- TSP solution → Dialog base: inherits (evidence: `osrm_dialog_tsp.py`)
- Batch routes → Dialog base: inherits (evidence: `osrm_batch_route_dialog.py`)
- Provider settings → Dialog base: inherits (evidence: `osrm_provider_dialog.py`)
- Single route → Routing utilities: uses utilities (evidence: `osrm_dialog.py`)
- Time matrix → Routing utilities: fetches table (evidence: `osrm_table_dialog.py`)
- Accessibility areas → Routing utilities: prepares access (evidence: `osrm_access_dialog.py`)
- TSP solution → Routing utilities: uses utilities (evidence: `osrm_dialog_tsp.py`)
- Batch routes → Routing utilities: uses utilities (evidence: `osrm_batch_route_dialog.py`)
- Provider settings → Routing utilities: uses utilities (evidence: `osrm_provider_dialog.py`)
- Routing utilities → Polyline decoder: decodes geometry (evidence: `osrm_utils.py`)
- Routing utilities → QGIS compatibility: uses compatibility (evidence: `osrm_utils.py`)
- Accessibility areas → QGIS compatibility: uses compatibility (evidence: `osrm_access_dialog.py`)
