# surveyorstories/gruhanaksha architecture

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

- Interactive diagram: https://gitdiagram.com/surveyorstories/gruhanaksha
- Repository: https://github.com/surveyorstories/gruhanaksha

## Overview

Gruhanaksha is a QGIS plugin for cadastral and land-survey work: users edit and inspect vector layers, then produce survey outputs. Its feature set includes geometry-editing tools, point creation and plot numbering, topology checks, traverse and alignment utilities, and KMZ/layout export. The sampled code confirms topology runs asynchronously and crash-recovery snapshots are delegated to a worker that writes through a database module. The README is empty and most modules were not sampled, so feature links reflect clear tool responsibilities rather than assumed internal call chains.

Main entry points: [`Gruhanaksha_provider.py`](https://github.com/surveyorstories/gruhanaksha/blob/main/Gruhanaksha_provider.py) (Processing provider), [`advanced_line.py`](https://github.com/surveyorstories/gruhanaksha/blob/main/advanced_line.py) (Advanced line tool), [`polygon_splitter.py`](https://github.com/surveyorstories/gruhanaksha/blob/main/polygon_splitter.py) (Polygon splitter), [`trim_and_extend.py`](https://github.com/surveyorstories/gruhanaksha/blob/main/trim_and_extend.py) (Trim and extend)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Plugin entry"]
  node_plugin["Plugin interface<br/>[Gruhanaksha.py]"]
  node_provider["Processing provider"]
end

subgraph group_editing["Geometry editing"]
  node_line_tool["Advanced line tool<br/>[advanced_line.py]"]
  node_splitter["Polygon splitter"]
  node_trim["Trim and extend<br/>[trim_and_extend.py]"]
  node_freehand["Freehand adjuster"]
  node_adjust["Polygon adjuster"]
  node_marker["Marker tool<br/>[marker_tool.py]"]
end

subgraph group_survey["Survey operations"]
  node_point_input["Point creator<br/>[pointinput.py]"]
  node_traverse["Traverse plotter"]
  node_aligner["Feature aligner<br/>[aligner.py]"]
  node_lpm["Plot numbering<br/>[lpm_canvas.py]"]
  node_fmb["Survey plotting tools<br/>[fmb.py]"]
end

subgraph group_quality["Quality and recovery"]
  node_topology_ui["Topology checker"]
  node_topology_task["Topology task"]
  node_topology_engine["Topology engine"]
  node_crash_worker["Recovery worker"]
  node_crash_db[("Recovery database")]
end

subgraph group_exports["Survey outputs"]
  node_kmz["KMZ exporter<br/>[kmz.py]"]
  node_atlas["Atlas export<br/>[atlas_export.py]"]
  node_ppm["PPM algorithm"]
  node_layout_assets["Print templates<br/>[PPM_Template.qpt]"]
end

node_qgis_user(("QGIS user"))
node_host["QGIS project layers"]

node_qgis_user -->|"opens tools"| node_plugin
node_qgis_user -->|"runs algorithms"| node_provider
node_qgis_user -->|"edits geometry"| node_line_tool
node_qgis_user -->|"splits polygons"| node_splitter
node_qgis_user -->|"edits geometry"| node_trim
node_qgis_user -->|"adjusts features"| node_freehand
node_qgis_user -->|"adjusts polygons"| node_adjust
node_qgis_user -->|"creates points"| node_point_input
node_qgis_user -->|"plots traverse"| node_traverse
node_qgis_user -->|"aligns features"| node_aligner
node_qgis_user -->|"numbers plots"| node_lpm
node_qgis_user -->|"plots survey features"| node_fmb
node_qgis_user -->|"checks topology"| node_topology_ui
node_qgis_user -->|"exports KMZ"| node_kmz
node_qgis_user -->|"exports atlas"| node_atlas
node_line_tool -->|"edits layer"| node_host
node_splitter -->|"splits layer"| node_host
node_trim -->|"updates geometry"| node_host
node_point_input -->|"adds features"| node_host
node_lpm -->|"numbers features"| node_host
node_topology_ui -->|"starts task"| node_topology_task
node_topology_task -->|"runs checks"| node_topology_engine
node_crash_worker -->|"writes snapshots"| node_crash_db
node_kmz -->|"exports layer data"| node_host
node_atlas -.->|"uses template"| node_layout_assets
node_provider -.->|"provides algorithm"| node_ppm

click node_plugin "https://github.com/surveyorstories/gruhanaksha/blob/main/Gruhanaksha.py"
click node_provider "https://github.com/surveyorstories/gruhanaksha/blob/main/Gruhanaksha_provider.py"
click node_line_tool "https://github.com/surveyorstories/gruhanaksha/blob/main/advanced_line.py"
click node_splitter "https://github.com/surveyorstories/gruhanaksha/blob/main/polygon_splitter.py"
click node_trim "https://github.com/surveyorstories/gruhanaksha/blob/main/trim_and_extend.py"
click node_freehand "https://github.com/surveyorstories/gruhanaksha/blob/main/freehand_adjuster.py"
click node_adjust "https://github.com/surveyorstories/gruhanaksha/blob/main/polygon_adjuster.py"
click node_marker "https://github.com/surveyorstories/gruhanaksha/blob/main/marker_tool.py"
click node_point_input "https://github.com/surveyorstories/gruhanaksha/blob/main/pointinput.py"
click node_traverse "https://github.com/surveyorstories/gruhanaksha/blob/main/traverse_plotter.py"
click node_aligner "https://github.com/surveyorstories/gruhanaksha/blob/main/aligner.py"
click node_lpm "https://github.com/surveyorstories/gruhanaksha/blob/main/lpm_canvas.py"
click node_fmb "https://github.com/surveyorstories/gruhanaksha/blob/main/fmb.py"
click node_topology_ui "https://github.com/surveyorstories/gruhanaksha/blob/main/topology_checker.py"
click node_topology_task "https://github.com/surveyorstories/gruhanaksha/blob/main/topology_checker.py"
click node_topology_engine "https://github.com/surveyorstories/gruhanaksha/blob/main/topology_checker.py"
click node_crash_worker "https://github.com/surveyorstories/gruhanaksha/blob/main/crash_recovery_worker.py"
click node_crash_db "https://github.com/surveyorstories/gruhanaksha/blob/main/crash_recovery_db.py"
click node_kmz "https://github.com/surveyorstories/gruhanaksha/blob/main/kmz.py"
click node_atlas "https://github.com/surveyorstories/gruhanaksha/blob/main/atlas_export.py"
click node_ppm "https://github.com/surveyorstories/gruhanaksha/blob/main/svamitvappm_algorithm.py"
click node_layout_assets "https://github.com/surveyorstories/gruhanaksha/blob/main/assets/templates/PPM_Template.qpt"

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_provider,node_qgis_user toneBlue
class node_line_tool,node_splitter,node_trim,node_freehand,node_adjust,node_marker toneAmber
class node_point_input,node_traverse,node_aligner,node_lpm,node_fmb toneMint
class node_topology_ui,node_topology_task,node_topology_engine,node_crash_worker,node_crash_db toneRose
class node_kmz,node_atlas,node_ppm,node_layout_assets,node_host toneIndigo
```

## Components

### Plugin entry

- [Plugin interface](https://github.com/surveyorstories/gruhanaksha/blob/main/Gruhanaksha.py): `Gruhanaksha.py`
- [Processing provider](https://github.com/surveyorstories/gruhanaksha/blob/main/Gruhanaksha_provider.py): `Gruhanaksha_provider.py`

### Geometry editing

- [Advanced line tool](https://github.com/surveyorstories/gruhanaksha/blob/main/advanced_line.py): `advanced_line.py`
- [Polygon splitter](https://github.com/surveyorstories/gruhanaksha/blob/main/polygon_splitter.py): `polygon_splitter.py`
- [Trim and extend](https://github.com/surveyorstories/gruhanaksha/blob/main/trim_and_extend.py): `trim_and_extend.py`
- [Freehand adjuster](https://github.com/surveyorstories/gruhanaksha/blob/main/freehand_adjuster.py): `freehand_adjuster.py`
- [Polygon adjuster](https://github.com/surveyorstories/gruhanaksha/blob/main/polygon_adjuster.py): `polygon_adjuster.py`
- [Marker tool](https://github.com/surveyorstories/gruhanaksha/blob/main/marker_tool.py): `marker_tool.py`

### Survey operations

- [Point creator](https://github.com/surveyorstories/gruhanaksha/blob/main/pointinput.py): `pointinput.py`
- [Traverse plotter](https://github.com/surveyorstories/gruhanaksha/blob/main/traverse_plotter.py): `traverse_plotter.py`
- [Feature aligner](https://github.com/surveyorstories/gruhanaksha/blob/main/aligner.py): `aligner.py`
- [Plot numbering](https://github.com/surveyorstories/gruhanaksha/blob/main/lpm_canvas.py): `lpm_canvas.py`
- [Survey plotting tools](https://github.com/surveyorstories/gruhanaksha/blob/main/fmb.py): `fmb.py`

### Quality and recovery

- [Topology checker](https://github.com/surveyorstories/gruhanaksha/blob/main/topology_checker.py): `topology_checker.py`
- [Topology task](https://github.com/surveyorstories/gruhanaksha/blob/main/topology_checker.py): `topology_checker.py`
- [Topology engine](https://github.com/surveyorstories/gruhanaksha/blob/main/topology_checker.py): `topology_checker.py`
- [Recovery worker](https://github.com/surveyorstories/gruhanaksha/blob/main/crash_recovery_worker.py): `crash_recovery_worker.py`
- [Recovery database](https://github.com/surveyorstories/gruhanaksha/blob/main/crash_recovery_db.py): `crash_recovery_db.py`

### Survey outputs

- [KMZ exporter](https://github.com/surveyorstories/gruhanaksha/blob/main/kmz.py): `kmz.py`
- [Atlas export](https://github.com/surveyorstories/gruhanaksha/blob/main/atlas_export.py): `atlas_export.py`
- [PPM algorithm](https://github.com/surveyorstories/gruhanaksha/blob/main/svamitvappm_algorithm.py): `svamitvappm_algorithm.py`
- [Print templates](https://github.com/surveyorstories/gruhanaksha/blob/main/assets/templates/PPM_Template.qpt): `assets/templates/PPM_Template.qpt`

### Other components

- **QGIS user**
- **QGIS project layers**

## Connections

- QGIS user → Plugin interface: opens tools
- QGIS user → Processing provider: runs algorithms
- QGIS user → Advanced line tool: edits geometry
- QGIS user → Polygon splitter: splits polygons
- QGIS user → Trim and extend: edits geometry
- QGIS user → Freehand adjuster: adjusts features
- QGIS user → Polygon adjuster: adjusts polygons
- QGIS user → Point creator: creates points
- QGIS user → Traverse plotter: plots traverse
- QGIS user → Feature aligner: aligns features
- QGIS user → Plot numbering: numbers plots
- QGIS user → Survey plotting tools: plots survey features
- QGIS user → Topology checker: checks topology
- QGIS user → KMZ exporter: exports KMZ
- QGIS user → Atlas export: exports atlas
- Advanced line tool → QGIS project layers: edits layer
- Polygon splitter → QGIS project layers: splits layer
- Trim and extend → QGIS project layers: updates geometry
- Point creator → QGIS project layers: adds features
- Plot numbering → QGIS project layers: numbers features
- Topology checker → Topology task: starts task
- Topology task → Topology engine: runs checks
- Recovery worker → Recovery database: writes snapshots
- KMZ exporter → QGIS project layers: exports layer data
- Atlas export → Print templates: uses template
- Processing provider → PPM algorithm: provides algorithm
