Tool to reduce GPX sizes by removing waypoints

Ahoi - Don't fork
This is my personal server. I try to maintain it and keep it running, but I cannot guarantee it.
So if you want to fork - especially if the idea is to have a backup - do not use the "Fork" button here.
Instead use

git clone --mirror
and push it to your preferred service like Codeberg

  • C# 97.3%
  • Dockerfile 1.9%
  • Shell 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-03-31 13:42:26 +02:00
.gitea ci: add FUNDING.yml for sponsor links 2026-03-31 13:42:26 +02:00
.github Add funding usernames for GitHub and Ko-fi 2026-02-18 15:40:14 +01:00
.vscode init (not running yet) 2026-02-06 13:50:44 +00:00
PocketBaseTrailRedux Clarify configuration setup in README 2026-02-10 09:17:13 +01:00
.gitignore cleanup 2026-02-07 12:33:15 +01:00
LICENSE init (not running yet) 2026-02-06 13:50:44 +00:00
README.md Update README with project usage link 2026-02-07 16:25:04 +01:00

PocketBase Trail Redux

Automatically reduces the file size of GPX tracks stored in a Wanderer PocketBase instance. Runs on a schedule, backs up the originals, replaces them with simplified versions, and optionally leaves a comment on the trail. (used on https://wadezimmer.de )

Setup

1. Create your configuration

Copy the example config and fill in your values:

cp config.example.json config.json

2. Start the service

docker compose up -d

Docker Compose

The docker-compose.yml contains everything needed to build and run the service:

services:
  trail-reader:
    build: .
    environment:
      - CRON_SCHEDULE=0 3 * * *
    volumes:
      - ./config.json:/app/config.json:ro
      - ./backups:/app/backups
      - ./state.json:/app/state.json
    restart: unless-stopped

Environment variables

Variable Default Description
CRON_SCHEDULE 0 3 * * * How often the service runs, in standard cron syntax. The default runs once a day at 03:00.

Volumes

Host path Container path Description
./config.json /app/config.json Your configuration file (mounted read-only).
./backups /app/backups Directory where original and simplified GPX files are stored before replacement.
./state.json /app/state.json Tracks which trails have been processed. Must exist on the host before starting (see step 2).

Configuration

Setting Description
LokiUrl URL of a Grafana Loki instance for log shipping. Leave empty to disable.
PocketBase.Url URL of your PocketBase / Wanderer instance (e.g. http://localhost:8090).
PocketBase.AdminEmail Email address of a PocketBase super user account.
PocketBase.AdminPassword Password for that account.
MinDistanceMeters Minimum distance in meters between GPS points, per trail category. Points closer together than this will be merged. Higher values = smaller files but less detail. Example: {"Biking": 10, "Walking": 5}
MinSizeKb Trails with a GPX file smaller than this (in KB) are skipped entirely.
MinRequiredSizePercent Only replace a GPX file if the simplified version is smaller than this percentage of the original. For example, 40 means the file must be reduced to at most 40% of its original size, otherwise it is kept as-is.
Comments.User Name of a local user (List "activitypub_actor" with "isLocal=true") in your Wanderer instance that will be used as the comment author. Leave empty to disable comments.
Comments.Content The HTML content of the comment that gets posted on a trail after its GPX file was replaced.

Backups

Before replacing any GPX file, the original is saved to the backups/ directory (organized by date). The simplified version is also stored there under a smaller/ subfolder, so you can always compare or restore. It is still recommened to do a Database backup before starting this program

Logs

Container logs are available via:

docker compose logs -f

If LokiUrl is configured, logs are also shipped to Grafana Loki.