library phpgpx
Simple GPX Parser
craygl/phpgpx
Simple GPX Parser
- Thursday, June 8, 2017
- by LiddleDev
- Repository
- 2 Watchers
- 2 Stars
- 82 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 1 Forks
- 0 Open issues
- 3 Versions
- 3 % Grown
PHPGPX
PHPGPX is an easy to use GPX Parser written in PHP., (*1)
Installation
Available via composer, (*2)
"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., (*3)