Metadata-Version: 2.4
Name: gpx-kml-converter
Version: 2.0.0
Summary: Easily convert, merge and compress GPX and KML files.
Author: pamagister
Requires-Python: <3.14,>=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.165.0
Requires-Dist: fastkml>=1.1.0
Requires-Dist: gpxpy>=1.6.2
Requires-Dist: jinja2>=3.1.6
Requires-Dist: lxml>=5.0.0
Requires-Dist: pygeoif>=1.5.1
Requires-Dist: pyproj>=3.7.0
Requires-Dist: python-multipart>=0.0.34
Requires-Dist: shapely>=2.1.1
Requires-Dist: srtm-py>=0.3.7
Requires-Dist: typer>=0.29.3
Requires-Dist: uvicorn>=0.55.0
Dynamic: license-file

# Welcome to gpx-kml-converter

[![Github CI Status](https://github.com/pamagister/gpx-kml-converter/actions/workflows/main.yml/badge.svg)](https://github.com/pamagister/gpx-kml-converter/actions)
[![GitHub release](https://img.shields.io/github/v/release/pamagister/gpx-kml-converter)](https://github.com/pamagister/gpx-kml-converter/releases)
[![Read the Docs](https://readthedocs.org/projects/gpx-kml-converter/badge/?version=stable)](https://gpx-kml-converter.readthedocs.io/en/stable/)
[![License](https://img.shields.io/github/license/pamagister/gpx-kml-converter)](https://github.com/pamagister/gpx-kml-converter/blob/main/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues/pamagister/gpx-kml-converter)](https://github.com/pamagister/gpx-kml-converter/issues)
[![PyPI](https://img.shields.io/pypi/v/gpx-kml-converter)](https://pypi.org/project/gpx-kml-converter/)

**gpx-kml-converter** is a local-first tool for managing a large collection of GPX and KML
files and exporting **compact GPX and POI files for a chosen region** — for example to prepare
the navigation data for a vacation. It runs as a **browser-based web application** (FastAPI +
SQLite) and ships a matching **command-line interface**. The productive collection is only ever
read; all derived data and exports are written to the application's data/cache directories or to
an output directory you choose.

## Installation

Download from [PyPI](https://pypi.org/).

💾 For more installation options see [install](https://gpx-kml-converter.readthedocs.io/en/stable/getting-started/install/).

```bash
pip install gpx-kml-converter
```

Start the web UI (default when no arguments are given):

```bash
gpx-kml-converter
```

Run the CLI:

```bash
gpx-kml-converter --help
```

## Main features 🚀

### 2.1. Web user interface 🖥️

The web UI is a dark, modern workspace that runs locally and binds to `127.0.0.1` by default.

* **Library browser:** browse, search and filter every indexed file with its track, route and
  POI counts, bounding box and duplicate badges.
* **Vector map:** an interactive MapLibre map with online vector tiles (OpenFreeMap by default)
  and the indexed tracks, routes and POIs drawn as GeoJSON overlays.
* **Region selection:** draw a rectangle (or click individual artifacts) to add exactly the data you
  want to export. Selections are additive, so multiple rectangles and individual artifacts refine one
  working set; **Clear** empties it. Named rectangles can be saved and re-applied against the current
  library.
* **Inspector and elevation:** a focused track or route drives an elevation profile, while the
  selection summary reports counts, total distance and available elevation gain, loss and range.
* **Compact export:** export the selected artifacts as a single combined `.gpx` (default) or as two
  files (tracks + POIs), with an optional Douglas–Peucker simplification tolerance. Exports are
  always generated from the indexed artifacts; original source files are never copied byte-for-byte.
* **Deduplication:** exact (SHA-256) and near-duplicate artifacts are flagged for review; nothing
  is ever deleted automatically, and duplicates are skipped in exports by default.
* **Archives:** `.zip`/`.kmz` contents are available only when the relevant source root is
  configured to index archives.

For details, see the [web UI documentation](usage/gui.md).

### 2.2. Command-line interface 🧑‍💻

The CLI shares the same backend and library database as the web UI:

| Command | Purpose |
| --- | --- |
| `gui` | Launch the local web UI (default when no command is given). |
| `index <paths...>` | Scan and index GPX/KML files into the local library (incremental). |
| `export` | Export a region (or the whole library) to compact GPX files. |
| `elevate` | Fill missing SRTM elevation data in the library. |
| `doctor` | Check the local environment and library health. |

For details, see the [CLI documentation](usage/cli.md).

### 2.3. Data handling 🗂️

* **Read-only guarantee:** source roots are opened read-only and are never modified or deleted.
* **SQLite library:** parsed geometry, metadata, content hashes and bounding boxes live in a
  single SQLite database; original files stay in place and are referenced by absolute path.
* **Incremental indexing:** unchanged files are skipped on re-scan using size, modification time
  and content hash.
* **Manual elevation:** the "Add missing elevation data" action fills missing waypoint and track
  elevations from SRTM and is idempotent.

## 3. Usage ▶️

### Run the web UI from source

```bash
python -m gpx_kml_converter
```

### Run the CLI from source

```bash
python -m gpx_kml_converter --help
```

The web UI opens in your browser at `http://127.0.0.1:8765/`. Use **index** to load a source
folder, then open the **Map** page to draw a region and export it.

## 4. Documentation

* [Installation](getting-started/install.md)
* [Web user interface](usage/gui.md)
* [Command-line interface](usage/cli.md)
* [Contributing](develop/contributing.md)
