PHPackages                             sibyx/phpgpx - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. sibyx/phpgpx

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

sibyx/phpgpx
============

A simple PHP library for GPX import/export

1.3.0(2y ago)1651.2M—6.6%55[6 issues](https://github.com/Sibyx/phpGPX/issues)[2 PRs](https://github.com/Sibyx/phpGPX/pulls)3MITPHPPHP &gt;=7.1CI passing

Since Feb 19Pushed 2mo ago9 watchersCompare

[ Source](https://github.com/Sibyx/phpGPX)[ Packagist](https://packagist.org/packages/sibyx/phpgpx)[ RSS](/packages/sibyx-phpgpx/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (16)Used By (3)

phpGPX
======

[](#phpgpx)

[![Code Climate](https://camo.githubusercontent.com/e4b9e6e129c2215839176932260d4ff24420ef252a5a8d7133619634eb2ff489/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f53696279782f7068704750582f6261646765732f6770612e737667)](https://codeclimate.com/github/Sibyx/phpGPX)[![Latest development](https://camo.githubusercontent.com/e0210e3efbe37fc2871c8ce4fda2c7b4693a60aced6e61eee929f6209fcce0a1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f73696279782f7068706770782e737667)](https://packagist.org/packages/sibyx/phpgpx)[![Packagist downloads](https://camo.githubusercontent.com/49c79d97563c302b70bec8dfe7c51677314e9441d8e044d209019b8d8ce1de0b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f73696279782f7068706770782e737667)](https://packagist.org/packages/sibyx/phpgpx)[![Gitter](https://camo.githubusercontent.com/5da68ef20d5b26b7dbc68ce7962620f5d53a68d64d38bcbe306f2d23a1c509f7/68747470733a2f2f696d672e736869656c64732e696f2f6769747465722f726f6f6d2f7068706770782f7068706770782e737667)](https://gitter.im/phpGPX/Lobby)

Simple library written in PHP for reading and creating [GPX files](https://en.wikipedia.org/wiki/GPS_Exchange_Format). [Documentation](https://sibyx.github.io/phpGPX/) is available using GitHub pages generated by Jekyll.

Contribution and feedback is welcome! Please check the issues for TODO. I will be happy every feature or pull request.

Repository branches:

- `master`: latest stable version
- `develop`: works on `2.x`

Features
--------

[](#features)

- Full support of [official specification](http://www.topografix.com/GPX/1/1/).
- Statistics calculation.
- Extensions.
- JSON &amp; XML &amp; PHP Array output.

### Supported Extensions

[](#supported-extensions)

- Garmin [TrackPointExtension](https://www8.garmin.com/xmlschemas/TrackPointExtensionv1.xsd):

### Stats calculation

[](#stats-calculation)

- (Smoothed) Distance (m)
- Average speed (m/s)
- Average pace (s/km)
- Min / max altitude (m)
- Min / max coordinates (\[lat,lng\])
- (Smoothed) Elevation gain / loss (m)
- Start / end (DateTime object)
- Start / end coordinates (\[lat,lng\])
- Duration (seconds)

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

[](#installation)

You can easily install phpGPX library with [composer](https://getcomposer.org/). There is no stable release yet, so please use release candidates.

```
composer require sibyx/phpgpx:1.3.0

```

Examples
--------

[](#examples)

### Open GPX file and load basic stats

[](#open-gpx-file-and-load-basic-stats)

```
