craygl / phpgpx
Simple GPX Parser
Installs: 123
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 1
pkg:composer/craygl/phpgpx
Requires
- php: >=5.3.0
 
This package is not auto-updated.
Last update: 2023-08-09 13:40:01 UTC
README
PHPGPX is an easy to use GPX Parser written in PHP.
Installation
Available via composer
"require": {
    "craygl/phpgpx": "^1.0"
}
Example Usage
$GPXParser = new GPXParser();
$gpx = $GPXParser->parseXML($xml);
foreach ($gpx->getTracks() as $track) {
    foreach ($track->getTrackSegments() as $trackSegment) {
        foreach ($trackSegment->getTrackPoints() as $waypoint) {
            echo 'Lat: ' . $waypoint->getLatitude() . ', Lon:' . $waypoint->getLongitude();
        }
    }
}
The above example will list the latitude and longitude of all the waypoints in all of the tracks.