# alensmailovic/gpx-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/alensmailovic/gpx-analyzer
- Repository: https://github.com/alensmailovic/gpx-analyzer

## Overview

GPX-Analyzer is a Streamlit application for exploring GPX routes. Users upload a GPX file or select an example; the app parses and summarizes the track, detects climbs and descents, and presents route, elevation, statistics, and segment details. Separate analysis views cover pace and GPS-signal quality, with the latter querying OpenStreetMap building data. The graph follows relationships visible in the excerpts and README; pace-analysis wiring and other unsampled tab behavior are not confirmed, so that link is marked unverified.

Main entry points: [`app.py`](https://github.com/alensmailovic/gpx-analyzer/blob/main/app.py) (Streamlit app), [`components/ui/elevation_chart.py`](https://github.com/alensmailovic/gpx-analyzer/blob/main/components/ui/elevation_chart.py) (Elevation chart), [`components/core/gpx_parser.py`](https://github.com/alensmailovic/gpx-analyzer/blob/main/components/core/gpx_parser.py) (GPX parser), [`components/ui/map_display.py`](https://github.com/alensmailovic/gpx-analyzer/blob/main/components/ui/map_display.py) (Route map)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["GPX Processing"]
  node_examples["Example GPX files"]
  node_app["Streamlit app<br/>[app.py]"]
  node_parser["GPX parser<br/>[gpx_parser.py]"]
  node_stats["Track statistics<br/>[stats.py]"]
  node_logging["Execution logging<br/>[logging.py]"]
end

subgraph group_analysis["Route Analysis"]
  node_climbs["Climb detector<br/>[climb_detector.py]"]
  node_coreutils["Slope utilities<br/>[utils.py]"]
end

subgraph group_views["User Views"]
  node_route["Route map<br/>[map_display.py]"]
  node_elevation["Elevation chart<br/>[elevation_chart.py]"]
  node_legend["Slope legend<br/>[legend.py]"]
  node_pace["Pace analysis<br/>[pace_analysis.py]"]
  node_segments["Segment details<br/>[segment_details.py]"]
  node_statspanel["Statistics panel<br/>[stats_panel.py]"]
end

subgraph group_signal["Signal Quality"]
  node_gps["GPS risk analysis"]
  node_overpass{{"Overpass services"}}
end

node_runner(("GPX user"))

node_runner -->|"uploads GPX"| node_app
node_examples -->|"reads example"| node_app
node_app -->|"parses track"| node_parser
node_parser -->|"computes summary"| node_stats
node_app -->|"detects segments"| node_climbs
node_app -->|"classifies climbs"| node_coreutils
node_app -->|"renders profile"| node_elevation
node_elevation -->|"smooths slope"| node_coreutils
node_app -->|"renders route"| node_route
node_route -->|"gets smoothed grade"| node_elevation
node_app -->|"displays legend"| node_legend
node_app -->|"shows statistics"| node_statspanel
node_app -->|"shows segment details"| node_segments
node_app -->|"records timings"| node_logging
node_app -->|"runs signal analysis"| node_gps
node_gps -->|"queries buildings"| node_overpass
node_app -.->|"may run analysis"| node_pace

click node_examples "https://github.com/alensmailovic/gpx-analyzer/tree/main/data"
click node_app "https://github.com/alensmailovic/gpx-analyzer/blob/main/app.py"
click node_parser "https://github.com/alensmailovic/gpx-analyzer/blob/main/components/core/gpx_parser.py"
click node_stats "https://github.com/alensmailovic/gpx-analyzer/blob/main/components/core/stats.py"
click node_climbs "https://github.com/alensmailovic/gpx-analyzer/blob/main/components/core/climb_detector.py"
click node_coreutils "https://github.com/alensmailovic/gpx-analyzer/blob/main/components/core/utils.py"
click node_gps "https://github.com/alensmailovic/gpx-analyzer/blob/main/utils/gps_signal_analysis.py"
click node_route "https://github.com/alensmailovic/gpx-analyzer/blob/main/components/ui/map_display.py"
click node_elevation "https://github.com/alensmailovic/gpx-analyzer/blob/main/components/ui/elevation_chart.py"
click node_legend "https://github.com/alensmailovic/gpx-analyzer/blob/main/components/ui/legend.py"
click node_pace "https://github.com/alensmailovic/gpx-analyzer/blob/main/components/ui/pace_analysis.py"
click node_segments "https://github.com/alensmailovic/gpx-analyzer/blob/main/components/ui/segment_details.py"
click node_statspanel "https://github.com/alensmailovic/gpx-analyzer/blob/main/components/ui/stats_panel.py"
click node_logging "https://github.com/alensmailovic/gpx-analyzer/blob/main/components/core/logging.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_examples,node_app,node_parser,node_stats,node_logging,node_runner toneBlue
class node_climbs,node_coreutils toneAmber
class node_route,node_elevation,node_legend,node_pace,node_segments,node_statspanel toneMint
class node_gps,node_overpass toneRose
```

## Components

### GPX Processing

- [Example GPX files](https://github.com/alensmailovic/gpx-analyzer/tree/main/data): `data`
- [Streamlit app](https://github.com/alensmailovic/gpx-analyzer/blob/main/app.py): `app.py`
- [GPX parser](https://github.com/alensmailovic/gpx-analyzer/blob/main/components/core/gpx_parser.py): `components/core/gpx_parser.py`
- [Track statistics](https://github.com/alensmailovic/gpx-analyzer/blob/main/components/core/stats.py): `components/core/stats.py`
- [Execution logging](https://github.com/alensmailovic/gpx-analyzer/blob/main/components/core/logging.py): `components/core/logging.py`

### Route Analysis

- [Climb detector](https://github.com/alensmailovic/gpx-analyzer/blob/main/components/core/climb_detector.py): `components/core/climb_detector.py`
- [Slope utilities](https://github.com/alensmailovic/gpx-analyzer/blob/main/components/core/utils.py): `components/core/utils.py`

### User Views

- [Route map](https://github.com/alensmailovic/gpx-analyzer/blob/main/components/ui/map_display.py): `components/ui/map_display.py`
- [Elevation chart](https://github.com/alensmailovic/gpx-analyzer/blob/main/components/ui/elevation_chart.py): `components/ui/elevation_chart.py`
- [Slope legend](https://github.com/alensmailovic/gpx-analyzer/blob/main/components/ui/legend.py): `components/ui/legend.py`
- [Pace analysis](https://github.com/alensmailovic/gpx-analyzer/blob/main/components/ui/pace_analysis.py): `components/ui/pace_analysis.py`
- [Segment details](https://github.com/alensmailovic/gpx-analyzer/blob/main/components/ui/segment_details.py): `components/ui/segment_details.py`
- [Statistics panel](https://github.com/alensmailovic/gpx-analyzer/blob/main/components/ui/stats_panel.py): `components/ui/stats_panel.py`

### Signal Quality

- [GPS risk analysis](https://github.com/alensmailovic/gpx-analyzer/blob/main/utils/gps_signal_analysis.py): `utils/gps_signal_analysis.py`
- **Overpass services**

### Other components

- **GPX user**

## Connections

- GPX user → Streamlit app: uploads GPX (evidence: `app.py`)
- Example GPX files → Streamlit app: reads example (evidence: `app.py`)
- Streamlit app → GPX parser: parses track (evidence: `app.py`)
- GPX parser → Track statistics: computes summary (evidence: `components/core/gpx_parser.py`)
- Streamlit app → Climb detector: detects segments (evidence: `app.py`)
- Streamlit app → Slope utilities: classifies climbs (evidence: `app.py`)
- Streamlit app → Elevation chart: renders profile (evidence: `app.py`)
- Elevation chart → Slope utilities: smooths slope (evidence: `components/ui/elevation_chart.py`)
- Streamlit app → Route map: renders route (evidence: `app.py`)
- Route map → Elevation chart: gets smoothed grade (evidence: `components/ui/map_display.py`)
- Streamlit app → Slope legend: displays legend (evidence: `app.py`)
- Streamlit app → Statistics panel: shows statistics (evidence: `app.py`)
- Streamlit app → Segment details: shows segment details (evidence: `app.py`)
- Streamlit app → Execution logging: records timings (evidence: `app.py`)
- Streamlit app → GPS risk analysis: runs signal analysis (evidence: `app.py`)
- GPS risk analysis → Overpass services: queries buildings (evidence: `utils/gps_signal_analysis.py`)
- Streamlit app → Pace analysis: may run analysis (evidence: `app.py`)
