Skip to main content

merge — Merge GPX files

Combines multiple GPX files into one. Points are sorted chronologically by default.

gpx-analyzer merge [files...] [flags]

Flags

FlagDescriptionDefault
-o, --outputOutput file pathmerged.gpx
--sortSort points by timetrue
--analyzeDisplay statistics for the merged resultfalse
--formatStats output format (if --analyze)text
--smoothingElevation smoothing (if --analyze)medium
--dem-dirSRTM tiles directory (if --analyze)(disabled)
--dem-auto-downloadAutomatically download missing SRTM tilestrue
--dem-cacheCache directory for downloaded tiles(OS cache dir)
--dem-max-memoryMaximum memory (MB) for loaded DEM tiles (0 = no limit)0
--dem-skip-validationSkip post-download DEM tile validation (faster)false
--elevation-thresholdElevation noise threshold (if --analyze)2.0
--elevation-algoElevation gain algorithm (if --analyze)threshold
--track-smoothingGPS track lat/lon smoothing (if --analyze)none
--dp-epsilonDouglas-Peucker: max vertical deviation (if --analyze)3.0
--seg-min-lengthSegments: minimum segment length (if --analyze)200.0
--seg-max-deviationSegments: max RMS residual (if --analyze)2.0
--presetStop detection preset (if --analyze)hiking
--max-hrMaximum heart rate (bpm) for HR zone calculation (if --analyze)0 (disabled)

Examples

Merge multiple files:

gpx-analyzer merge day1.gpx day2.gpx day3.gpx -o full-hike.gpx

Merge all GPX files in a directory and display stats:

gpx-analyzer merge ./vacation-tracks/ -o vacation.gpx --analyze

Merge segments from a previous split:

gpx-analyzer merge ./splits/ -o reassembled.gpx --analyze

Merge without sorting (keep file order):

gpx-analyzer merge a.gpx b.gpx c.gpx -o concat.gpx --sort=false

Merge with JSON analysis and DEM:

gpx-analyzer merge ./stages/ -o full.gpx --analyze --format json --dem-dir ./srtm/