# linz/topographic-qgis-plugin architecture

> Architecture diagram of the GitHub repository linz/topographic-qgis-plugin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/linz/topographic-qgis-plugin
- Repository: https://github.com/linz/topographic-qgis-plugin

## Overview

Topographic Mapping is a QGIS plugin for editing topographic feature layers, managing labels and styles, and validating mapped data. The main workflow is a QGIS user choosing editing tools and a target layer, editing or labeling features, then reviewing validation results. The plugin also supports project/layer management, product-view creation, custom rock-outcrop symbols, and optional style downloads. Source excerpts show only part of the wiring; relationships not demonstrated in those excerpts or the source index are omitted.

Main entry points: [`topographic_mapping/plugin.py`](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/plugin.py) (Plugin setup), [`topographic_mapping/gui/labeling_gui_manager.py`](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/labeling_gui_manager.py) (Labeling controls), [`topographic_mapping/core/stored_object_manager.py`](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/core/stored_object_manager.py) (Plugin data storage), [`topographic_mapping/gui/style_manager.py`](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/style_manager.py) (Layer styles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plugin["Plugin and project"]
  node_plugin_entry["Plugin setup<br/>[plugin.py]"]
  node_project["Project controller"]
  node_state["Editing state<br/>[state_manager.py]"]
  node_stored_data[("Plugin data storage")]
  node_settings["Plugin settings<br/>[settings.py]"]
  node_db_utils["Product view utilities<br/>[db_utils.py]"]
  node_markup["Markup management<br/>[markup_manager.py]"]
end

subgraph group_editing["Editing tools"]
  node_tool_registry["Tool registry<br/>[tool_registry.py]"]
  node_tool_dock["Editing tool dock<br/>[tool_dock.py]"]
  node_edit_dock["Feature editing dock<br/>[edit_tool_dock.py]"]
  node_feature_types["Feature type model"]
end

subgraph group_labels["Labeling"]
  node_label_gui["Labeling controls"]
  node_label_manager["Label operations<br/>[label_manager.py]"]
  node_label_tools["Label map tools<br/>[label_tool_base.py]"]
  node_digitize_label["Label digitizing"]
  node_wrap_label["Label wrapping<br/>[label_wrap_tool.py]"]
  node_select_label["Label selection"]
end

subgraph group_validation["Validation"]
  node_validation_dock["Validation dock<br/>[validation_dock.py]"]
  node_validation_results["Validation results"]
  node_validation_utils["Validation checks"]
end

subgraph group_presentation["Styles and symbols"]
  node_style_manager["Layer styles<br/>[style_manager.py]"]
  node_rock_symbol["Rock outcrop symbol<br/>[rock_outcrop.py]"]
  node_rock_widget["Symbol settings widget"]
end

node_user(("QGIS user"))

node_user -->|"uses tools"| node_tool_dock
node_plugin_entry -->|"creates"| node_project
node_plugin_entry -->|"adds dock"| node_tool_dock
node_plugin_entry -->|"registers tools"| node_label_gui
node_plugin_entry -->|"registers symbol"| node_rock_symbol
node_tool_registry -->|"tracks selection"| node_state
node_edit_dock -->|"uses model"| node_feature_types
node_label_gui -->|"gets actions"| node_tool_registry
node_label_gui -->|"creates tool"| node_select_label
node_label_gui -->|"sets target"| node_digitize_label
node_label_tools -.->|"supports labeling"| node_label_manager
node_label_gui -.->|"activates tool"| node_wrap_label
node_validation_dock -.->|"displays results"| node_validation_results
node_validation_utils -->|"reads objects"| node_stored_data
node_markup -->|"uses storage"| node_stored_data
node_style_manager -->|"styles layers"| node_project
node_rock_widget -->|"configures symbol"| node_rock_symbol
node_plugin_entry -->|"creates views"| node_db_utils
node_plugin_entry -.->|"initializes state"| node_state
node_style_manager -.->|"stores downloads"| node_stored_data

click node_plugin_entry "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/plugin.py"
click node_project "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/core/project_controller.py"
click node_state "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/core/state_manager.py"
click node_stored_data "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/core/stored_object_manager.py"
click node_settings "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/settings.py"
click node_tool_registry "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/tool_registry.py"
click node_tool_dock "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/tool_dock.py"
click node_edit_dock "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/edit_tool_dock.py"
click node_feature_types "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/feature_type_model.py"
click node_label_gui "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/labeling_gui_manager.py"
click node_label_manager "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/core/label_manager.py"
click node_label_tools "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/label_tool_base.py"
click node_digitize_label "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/digitize_label_tool.py"
click node_wrap_label "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/label_wrap_tool.py"
click node_select_label "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/select_by_label_tool.py"
click node_validation_dock "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/validation_dock.py"
click node_validation_results "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/core/validation_results_model.py"
click node_validation_utils "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/core/validation_utils.py"
click node_style_manager "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/style_manager.py"
click node_rock_symbol "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/core/symbol_layers/rock_outcrop.py"
click node_rock_widget "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/symbol_layers/rock_outcrop_widget.py"
click node_db_utils "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/core/db_utils.py"
click node_markup "https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/core/markup_manager.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_entry,node_project,node_state,node_stored_data,node_settings,node_db_utils,node_markup,node_user toneBlue
class node_tool_registry,node_tool_dock,node_edit_dock,node_feature_types toneAmber
class node_label_gui,node_label_manager,node_label_tools,node_digitize_label,node_wrap_label,node_select_label toneMint
class node_validation_dock,node_validation_results,node_validation_utils toneRose
class node_style_manager,node_rock_symbol,node_rock_widget toneIndigo
```

## Components

### Plugin and project

- [Plugin setup](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/plugin.py): `topographic_mapping/plugin.py`
- [Project controller](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/core/project_controller.py): `topographic_mapping/core/project_controller.py`
- [Editing state](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/core/state_manager.py): `topographic_mapping/core/state_manager.py`
- [Plugin data storage](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/core/stored_object_manager.py): `topographic_mapping/core/stored_object_manager.py`
- [Plugin settings](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/settings.py): `topographic_mapping/settings.py`
- [Product view utilities](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/core/db_utils.py): `topographic_mapping/core/db_utils.py`
- [Markup management](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/core/markup_manager.py): `topographic_mapping/core/markup_manager.py`

### Editing tools

- [Tool registry](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/tool_registry.py): `topographic_mapping/gui/tool_registry.py`
- [Editing tool dock](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/tool_dock.py): `topographic_mapping/gui/tool_dock.py`
- [Feature editing dock](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/edit_tool_dock.py): `topographic_mapping/gui/edit_tool_dock.py`
- [Feature type model](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/feature_type_model.py): `topographic_mapping/gui/feature_type_model.py`

### Labeling

- [Labeling controls](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/labeling_gui_manager.py): `topographic_mapping/gui/labeling_gui_manager.py`
- [Label operations](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/core/label_manager.py): `topographic_mapping/core/label_manager.py`
- [Label map tools](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/label_tool_base.py): `topographic_mapping/gui/label_tool_base.py`
- [Label digitizing](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/digitize_label_tool.py): `topographic_mapping/gui/digitize_label_tool.py`
- [Label wrapping](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/label_wrap_tool.py): `topographic_mapping/gui/label_wrap_tool.py`
- [Label selection](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/select_by_label_tool.py): `topographic_mapping/gui/select_by_label_tool.py`

### Validation

- [Validation dock](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/validation_dock.py): `topographic_mapping/gui/validation_dock.py`
- [Validation results](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/core/validation_results_model.py): `topographic_mapping/core/validation_results_model.py`
- [Validation checks](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/core/validation_utils.py): `topographic_mapping/core/validation_utils.py`

### Styles and symbols

- [Layer styles](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/style_manager.py): `topographic_mapping/gui/style_manager.py`
- [Rock outcrop symbol](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/core/symbol_layers/rock_outcrop.py): `topographic_mapping/core/symbol_layers/rock_outcrop.py`
- [Symbol settings widget](https://github.com/linz/topographic-qgis-plugin/blob/master/topographic_mapping/gui/symbol_layers/rock_outcrop_widget.py): `topographic_mapping/gui/symbol_layers/rock_outcrop_widget.py`

### Other components

- **QGIS user**

## Connections

- QGIS user → Editing tool dock: uses tools (evidence: `topographic_mapping/gui/tool_dock.py`)
- Plugin setup → Project controller: creates (evidence: `topographic_mapping/plugin.py`)
- Plugin setup → Editing tool dock: adds dock (evidence: `topographic_mapping/plugin.py`)
- Plugin setup → Labeling controls: registers tools (evidence: `topographic_mapping/plugin.py`)
- Plugin setup → Rock outcrop symbol: registers symbol (evidence: `topographic_mapping/plugin.py`)
- Tool registry → Editing state: tracks selection (evidence: `topographic_mapping/gui/tool_registry.py`)
- Feature editing dock → Feature type model: uses model (evidence: `topographic_mapping/gui/edit_tool_dock.py`)
- Labeling controls → Tool registry: gets actions (evidence: `topographic_mapping/gui/labeling_gui_manager.py`)
- Labeling controls → Label selection: creates tool (evidence: `topographic_mapping/gui/labeling_gui_manager.py`)
- Labeling controls → Label digitizing: sets target (evidence: `topographic_mapping/gui/labeling_gui_manager.py`)
- Label map tools → Label operations: supports labeling
- Labeling controls → Label wrapping: activates tool (evidence: `topographic_mapping/gui/labeling_gui_manager.py`)
- Validation dock → Validation results: displays results
- Validation checks → Plugin data storage: reads objects (evidence: `topographic_mapping/core/validation_utils.py`)
- Markup management → Plugin data storage: uses storage (evidence: `topographic_mapping/core/markup_manager.py`)
- Layer styles → Project controller: styles layers (evidence: `topographic_mapping/gui/style_manager.py`)
- Symbol settings widget → Rock outcrop symbol: configures symbol (evidence: `topographic_mapping/gui/symbol_layers/rock_outcrop_widget.py`)
- Plugin setup → Product view utilities: creates views (evidence: `topographic_mapping/plugin.py`)
- Plugin setup → Editing state: initializes state
- Layer styles → Plugin data storage: stores downloads (evidence: `topographic_mapping/gui/style_manager.py`)
