Skip to content

仓库 files navigation

Bable

CI

A native Swift rebuild of the parts of GPSBabel that matter for modern workflows: file format conversion and track cleanup/filtering, on macOS Tahoe and later. No Qt, no legacy dependencies — a SwiftUI app, a gpsbabel-style command-line tool, and a reusable platform-independent core library.

Everything is implemented clean-room from public format specifications (GPSBabel is GPL-2.0; no code was ported).

Quick start

Requirements: macOS 15 or later (Apple Silicon or Intel).

  1. Download Bable-x.y.z.zip from the latest release and unzip it.
  2. The app is not notarized, so the first launch needs one extra step — right-click Bable.app → Open → Open. (Or clear quarantine once: xattr -dr com.apple.quarantine Bable.app.) Every launch after that is normal.
  3. Drop a GPS file (GPX, KML, KMZ, TCX, FIT, CSV, or NMEA log) onto the window, or press ⌘O.
  4. The sidebar shows what was loaded (waypoints/routes/tracks, time range); the map shows where it is.
  5. Optionally click + Add under Filters to stack cleanup steps — e.g. Remove duplicates then Simplify with a 10 m error. The counts and the map preview update live, and filters apply top-to-bottom (drag to reorder, trash icon to remove). Every filter is documented in the app: press ⌘? or click the ? next to the Filters heading.
  6. Pick an output format at the bottom, click Export… (⌘E), choose where to save. Done.

A typical first task — shrink a bloated GPS track for sharing: drop the file, add Remove duplicates, add Simplify → point budget → 500, export as GPX.

Formats

Format Read Write
GPX 1.1 (reads 1.0)
Google Earth KML / KMZ
Garmin Training Center TCX
Garmin FIT
CSV (flexible column headers)
NMEA 0183 (GGA/RMC)

Heart rate, cadence, speed, power, and temperature travel across formats that support them (GPX Garmin extensions ↔ TCX ↔ FIT).

Filters

Duplicate removal · Douglas-Peucker simplification (max error or point budget) · gap interpolation · radius and bounding-box include/exclude · reverse · waypoint sort · track merge/split · waypoint↔route↔track transforms. Filters chain in order, exactly like gpsbabel -x.

Every filter is documented in the app's built-in help (⌘?): purpose, parameters, usage tips, and the matching CLI command.

Building from source

git clone https://github.com/DaveKT/bable.git && cd bable
./scripts/make-app.sh   # builds Bable.app in the repo root

Requires Xcode (Swift 6+). No third-party dependencies — the first build needs no network access.

The CLI

Everything the app does is also scriptable:

swift build -c release
.build/release/bable -f ride.fit -x simplify,error=5 -x dedupe -F ride.gpx

To install it on your PATH:

install .build/release/bable /usr/local/bin/

Useful commands:

bable formats                       # what can be read/written
bable --help                        # full filter reference with options
bable -f track.gpx                  # summarize a file without converting
bable -f log.nmea -F track.kmz      # formats inferred from extensions
bable -i gpx -f data.txt -o kml -F out.kml   # ...or forced with -i/-o
bable -f ride.gpx -x split,time=3600 -F rides.gpx   # split at 1h gaps

Filters chain left to right with repeated -x, exactly like gpsbabel.

Library

BableCore is a Foundation-only Swift package target (macOS 15+/iOS 17+) — usable from a future iOS app unchanged. FormatRegistry.read(from:), FilterChain, FormatRegistry.write(_:to:) is the whole API surface.

Development

swift test              # unit + round-trip tests

If Homebrew gpsbabel is installed, differential oracle tests also run, comparing Bable's output against GPSBabel's for the same inputs.

Working documents live in docs/ — start with docs/PLAN.md.

License

Bable is released under the MIT License — free to use, modify, and redistribute, including commercially, provided the copyright notice and permission notice are retained.

Everything in this repository is original work, written clean-room from public format specifications. GPSBabel (GPL-2.0) source was never ported or translated; the gpsbabel binary is used only as an external differential test oracle and no part of it is distributed with Bable.

Two exceptions to the MIT grant: the screenshots in docs/screenshots/ include Apple Maps imagery, which remains subject to Apple's terms, and format names such as GPX, KML, TCX, and FIT are referenced only for compatibility. All trademarks belong to their respective owners.

关于

Native Swift rebuild of GPSBabel's core: GPS format conversion (GPX, KML/KMZ, TCX, FIT, CSV, NMEA) and track filtering for modern macOS — SwiftUI app, CLI, and library

Resources

Stars

0 stars

关注者

0 watching

复刻s

发布

贡献者

Languages