PHPackages                             twohundredcouches/gpx-merger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. twohundredcouches/gpx-merger

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

twohundredcouches/gpx-merger
============================

Merges multiple gpx files into one

1.1.0(4y ago)214MITPHPPHP &gt;=7.4.0

Since Aug 14Pushed 4y ago1 watchersCompare

[ Source](https://github.com/twohundredcouches/gpx-merger)[ Packagist](https://packagist.org/packages/twohundredcouches/gpx-merger)[ Docs](https://github.com/twohundredcouches/gpx-merger)[ RSS](/packages/twohundredcouches-gpx-merger/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (1)Versions (4)Used By (0)

GPX Merger
==========

[](#gpx-merger)

This library merges waypoints, routes and tracks from gpx files into a single gpx file.

Installation
------------

[](#installation)

```
$ composer require twohundredcouches/gpx-merger

```

Usage
-----

[](#usage)

```
use TwohundredCouches\GpxMerger\GpxMerger;
use TwohundredCouches\GpxMerger\Model\GpxMetaData;

$files = ['path/to/file1.gpx', 'path/to/file2.gpx', 'path/to/file3.gpx'];

$destination = 'path/to/frankfurt-merged.gpx';

$optionalMetaData = GpxMetaData::create(
    // name
    'Frankfurt Tour',
    // description
    'My hike tour in Frankfurt',
    // author
    'Jane Doe'
);

$compression = 0.0;

GpxMerger::merge($filesToMerge, $destination, $optionalMetaData, $compression);

```

Classes
-------

[](#classes)

### `GpxMerger`

[](#gpxmerger)

Main class of this package. Provides a static merge function.

##### `merge(array $files, ?string $destination = null, GpxMetaData $metaData = null, float $compression = 0.0): string`

[](#mergearray-files-string-destination--null-gpxmetadata-metadata--null-float-compression--00-string)

*Return:* `string`

*Throws:* `GpxMergerException`

Merges the provided array of `.gpx` files into a single file, that can be defined with `$destination`. If a GpxMetaData object is provided the given metadata will be added to that file. For compression you can pass a float value between 0 (no compression) and 1 (maximum compression). Compression means that waypoint, route and track nodes get removed from the gpx file. A compression value of 1.0 means that every node, except for the first and last one, which are always preserved, will be removed. A compression value of 0.5 means that 50% of the nodes will be removed and 0.0 that there will be no nodes removed at all (this is the default). Returns the path of the output file.

### `GpxMetaData`

[](#gpxmetadata)

*Namespace:* `TwohundredCouches\GpxMerger\Model`

An object to add name, description and author as metadata to a merged file. Provides a static create method as alternative to the constructor.

##### `__construct(?string $name, ?string $description = null, ?string $author = null): GpxMetaData`

[](#__constructstring-name-string-description--null-string-author--null-gpxmetadata)

*Return:* `GpxMetaData`

Returns a GpxMetaData object with the provided fields (all optional).

##### `create(?string $name, ?string $description = null, ?string $author = null): GpxMetaData`

[](#createstring-name-string-description--null-string-author--null-gpxmetadata)

*Return:* `GpxMetaData`

Returns a GpxMetaData object with the provided fields (all optional).

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~9 days

Total

3

Last Release

1767d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1911edf6e591df79a18831a7e47d3f132e4ff05118aafbe9562f423bc07bca42?d=identicon)[twohundredcouches](/maintainers/twohundredcouches)

---

Top Contributors

[![GeneralZombie](https://avatars.githubusercontent.com/u/75695042?v=4)](https://github.com/GeneralZombie "GeneralZombie (3 commits)")

---

Tags

gpx

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/twohundredcouches-gpx-merger/health.svg)

```
[![Health](https://phpackages.com/badges/twohundredcouches-gpx-merger/health.svg)](https://phpackages.com/packages/twohundredcouches-gpx-merger)
```

###  Alternatives

[openpsa/universalfeedcreator

RSS and Atom feed generator by Kai Blankenhorn

3596.4k2](/packages/openpsa-universalfeedcreator)[funiq/geophp

Open-source native PHP library for doing geometry operations. Can read and write a wide variety of formats: (E)WKT, (E)WKB, TWKB, GeoJSON, KML, GPX, GeoRSS. Works with all Simple-Feature geometries (Point, LineString, Polygon...) and can be used to get centroids, bounding-boxes, area, etc.

22117.8k1](/packages/funiq-geophp)[illuminate/workbench

The Illuminate Workbench package.

3329.8k2](/packages/illuminate-workbench)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
