# yvind/omap-rs architecture

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

- Interactive diagram: https://gitdiagram.com/yvind/omap-rs
- Repository: https://github.com/yvind/omap-rs

## Overview

Omap-rs is a Rust library for reading, creating, editing, transforming, and writing OpenOrienteering Mapper .omap maps. The main workflow loads a file or starts from an empty/default map, edits map parts with symbol-linked objects and color definitions, optionally transforms paper coordinates through georeferencing, then writes the map. The map also carries templates, notes, and view settings. Paths and workflow stages reflect the tree and README; unsampled internals are shown only where documented, and their specific call wiring is left out.

Main entry points: [`src/omap.rs`](https://github.com/yvind/omap-rs/blob/master/src/omap.rs) (Omap API), [`src/objects/mod.rs`](https://github.com/yvind/omap-rs/blob/master/src/objects/mod.rs) (Map objects), [`src/symbols/symbol_set.rs`](https://github.com/yvind/omap-rs/blob/master/src/symbols/symbol_set.rs) (Symbol set), [`src/parts/map_parts.rs`](https://github.com/yvind/omap-rs/blob/master/src/parts/map_parts.rs) (Map parts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_map_io["Map lifecycle"]
  node_omap["Omap API<br/>[omap.rs]"]
end

subgraph group_map_content["Map content"]
  node_parts["Map parts<br/>[map_parts.rs]"]
  node_objects["Map objects<br/>[mod.rs]"]
  node_geometry["Bezier geometry<br/>[area_object.rs]"]
  node_symbols["Symbol set<br/>[symbol_set.rs]"]
  node_symbol_defs["Symbol definitions<br/>[mod.rs]"]
  node_colors["Color set<br/>[color_set.rs]"]
end

subgraph group_spatial["Spatial support"]
  node_georef["Georeferencing<br/>[geo_ref.rs]"]
  node_transform["Map transform<br/>[map_transform.rs]"]
end

subgraph group_presentation["Map presentation"]
  node_templates["Templates<br/>[mod.rs]"]
  node_notes["Map notes<br/>[notes.rs]"]
  node_view["View settings<br/>[view.rs]"]
end

node_user(("Library user"))
node_omap_file["OMAP file"]

node_user -->|"creates or loads"| node_omap
node_omap_file -->|"read by"| node_omap
node_omap -->|"writes"| node_omap_file
node_omap -->|"manages"| node_parts
node_omap -->|"manages"| node_symbols
node_omap -->|"manages"| node_colors
node_omap -->|"manages"| node_georef
node_omap -->|"manages"| node_templates
node_omap -->|"manages"| node_notes
node_omap -->|"manages"| node_view
node_parts -->|"holds"| node_objects
node_objects -->|"stores"| node_geometry
node_objects -->|"references"| node_symbols
node_symbols -->|"owns"| node_symbol_defs
node_georef -->|"creates"| node_transform
node_user -->|"uses"| node_transform

click node_omap "https://github.com/yvind/omap-rs/blob/master/src/omap.rs"
click node_parts "https://github.com/yvind/omap-rs/blob/master/src/parts/map_parts.rs"
click node_objects "https://github.com/yvind/omap-rs/blob/master/src/objects/mod.rs"
click node_geometry "https://github.com/yvind/omap-rs/blob/master/src/objects/area_object.rs"
click node_symbols "https://github.com/yvind/omap-rs/blob/master/src/symbols/symbol_set.rs"
click node_symbol_defs "https://github.com/yvind/omap-rs/blob/master/src/symbols/mod.rs"
click node_colors "https://github.com/yvind/omap-rs/blob/master/src/colors/color_set.rs"
click node_georef "https://github.com/yvind/omap-rs/blob/master/src/geo_referencing/geo_ref.rs"
click node_transform "https://github.com/yvind/omap-rs/blob/master/src/geo_referencing/map_transform.rs"
click node_templates "https://github.com/yvind/omap-rs/blob/master/src/templates/mod.rs"
click node_notes "https://github.com/yvind/omap-rs/blob/master/src/notes.rs"
click node_view "https://github.com/yvind/omap-rs/blob/master/src/view.rs"

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_omap,node_user toneBlue
class node_parts,node_objects,node_geometry,node_symbols,node_symbol_defs,node_colors toneAmber
class node_georef,node_transform toneMint
class node_templates,node_notes,node_view toneRose
class node_omap_file toneIndigo
```

## Components

### Map lifecycle

- [Omap API](https://github.com/yvind/omap-rs/blob/master/src/omap.rs): `src/omap.rs`

### Map content

- [Map parts](https://github.com/yvind/omap-rs/blob/master/src/parts/map_parts.rs): `src/parts/map_parts.rs`
- [Map objects](https://github.com/yvind/omap-rs/blob/master/src/objects/mod.rs): `src/objects/mod.rs`
- [Bezier geometry](https://github.com/yvind/omap-rs/blob/master/src/objects/area_object.rs): `src/objects/area_object.rs`
- [Symbol set](https://github.com/yvind/omap-rs/blob/master/src/symbols/symbol_set.rs): `src/symbols/symbol_set.rs`
- [Symbol definitions](https://github.com/yvind/omap-rs/blob/master/src/symbols/mod.rs): `src/symbols/mod.rs`
- [Color set](https://github.com/yvind/omap-rs/blob/master/src/colors/color_set.rs): `src/colors/color_set.rs`

### Spatial support

- [Georeferencing](https://github.com/yvind/omap-rs/blob/master/src/geo_referencing/geo_ref.rs): `src/geo_referencing/geo_ref.rs`
- [Map transform](https://github.com/yvind/omap-rs/blob/master/src/geo_referencing/map_transform.rs): `src/geo_referencing/map_transform.rs`

### Map presentation

- [Templates](https://github.com/yvind/omap-rs/blob/master/src/templates/mod.rs): `src/templates/mod.rs`
- [Map notes](https://github.com/yvind/omap-rs/blob/master/src/notes.rs): `src/notes.rs`
- [View settings](https://github.com/yvind/omap-rs/blob/master/src/view.rs): `src/view.rs`

### Other components

- **Library user**
- **OMAP file**

## Connections

- Library user → Omap API: creates or loads
- OMAP file → Omap API: read by
- Omap API → OMAP file: writes
- Omap API → Map parts: manages
- Omap API → Symbol set: manages
- Omap API → Color set: manages
- Omap API → Georeferencing: manages
- Omap API → Templates: manages
- Omap API → Map notes: manages
- Omap API → View settings: manages
- Map parts → Map objects: holds
- Map objects → Bezier geometry: stores
- Map objects → Symbol set: references
- Symbol set → Symbol definitions: owns
- Georeferencing → Map transform: creates
- Library user → Map transform: uses
