PHPackages                             abduns/laravel-gpx-reader - 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. abduns/laravel-gpx-reader

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

abduns/laravel-gpx-reader
=========================

A Laravel package to read and work with GPX 1.1 files.

v2.0.0(5mo ago)120MITPHPPHP ^8.2

Since Dec 8Pushed 2mo agoCompare

[ Source](https://github.com/abduns/laravel-gpx-reader)[ Packagist](https://packagist.org/packages/abduns/laravel-gpx-reader)[ RSS](/packages/abduns-laravel-gpx-reader/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (4)Used By (0)

Laravel GPX Reader
==================

[](#laravel-gpx-reader)

[![Latest Version on Packagist](https://camo.githubusercontent.com/3f2e93e5821c445cb3ef61e662185539631d49d689f755659319767480d72be3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616264756e732f6c61726176656c2d6770782d7265616465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/abduns/laravel-gpx-reader)[![License](https://camo.githubusercontent.com/157b84cddb8e2f23d1487301adff65208127e7473a56af624d1d98c84679224d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616264756e732f6c61726176656c2d6770782d7265616465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/abduns/laravel-gpx-reader)

A robust, dependency-free Laravel package to parse and work with GPX 1.1 files. Convert GPX XML into rich, type-safe PHP objects.

Features
--------

[](#features)

- 🚀 **GPX 1.1 Support**: Fully compliant with the GPX 1.1 schema.
- 📦 **No External Dependencies**: Uses native PHP XML parsing.
- 🛠 **Laravel Integration**: Includes Facade, Service Provider, and Config.
- 🛡 **Type-Safe DTOs**: Work with rich PHP objects (`Track`, `Route`, `Waypoint`) instead of raw arrays or XML.
- ✅ **Validation**: Optional strict mode to ensure GPX validity.

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

[](#installation)

You can install the package via composer:

```
composer require abduns/laravel-gpx-reader
```

Usage
-----

[](#usage)

### Parsing a GPX file

[](#parsing-a-gpx-file)

You can parse a GPX file from a path or a string using the `Gpx` facade.

```
use Dunn\GpxReader\Facades\Gpx;

// From file
$gpx = Gpx::parseFromFile('path/to/file.gpx');

// From string
$gpx = Gpx::parseFromString($xmlString);
```

### Working with the GPX Document

[](#working-with-the-gpx-document)

The parser returns a `Dunn\GpxReader\DTO\GpxDocument` object, which mirrors the GPX 1.1 schema.

```
// Access metadata
echo $gpx->creator;
echo $gpx->version;
if ($gpx->metadata) {
    echo $gpx->metadata->name;
    echo $gpx->metadata->desc;
    echo $gpx->metadata->time?->format('Y-m-d H:i:s');
}

// Access Waypoints
foreach ($gpx->waypoints as $waypoint) {
    echo "Waypoint: {$waypoint->name} ({$waypoint->latitude}, {$waypoint->longitude})";
    echo " - Elevation: {$waypoint->elevation}"; // Access elevation
}

// Access Routes
foreach ($gpx->routes as $route) {
    echo "Route: {$route->name}";
    foreach ($route->points as $point) {
        echo " - Point: {$point->latitude}, {$point->longitude}";
        echo " - Elevation: {$point->elevation}"; // Access elevation
    }
}

// Access Tracks
foreach ($gpx->tracks as $track) {
    echo "Track: {$track->name}";
    foreach ($track->segments as $segment) {
        foreach ($segment->points as $point) {
            echo " - Point: {$point->latitude}, {$point->longitude}";
            echo " - Elevation: {$point->elevation}"; // Access elevation
        }
    }
}
```

### Configuration

[](#configuration)

You can publish the config file with:

```
php artisan vendor:publish --tag="gpx-config"
```

The config file allows you to configure strict mode and timezone.

```
return [
    'strict_mode' => true, // Throw exceptions for invalid GPX structure
    'timezone' => 'UTC',
];
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance79

Regular maintenance activity

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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 ~0 days

Total

3

Last Release

155d ago

Major Versions

v1.0.1 → v2.0.02025-12-08

PHP version history (3 changes)v1.0.0PHP ^8.1

v1.0.1PHP ^8.0

v2.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b6db958737ac4cee88ee13e763deda49b07e65052710a8e6ef2ce70732e038d?d=identicon)[abduns](/maintainers/abduns)

---

Top Contributors

[![abduns](https://avatars.githubusercontent.com/u/28977075?v=4)](https://github.com/abduns "abduns (7 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/abduns-laravel-gpx-reader/health.svg)

```
[![Health](https://phpackages.com/badges/abduns-laravel-gpx-reader/health.svg)](https://phpackages.com/packages/abduns-laravel-gpx-reader)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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