GPXIN-24 introduced support for ingesting waypoints defined in the source GPX file. A natural extension of that would be to add support for the
rteType .
For purposes of clarity: A route is the planned route, whereas the track is the path ultimately followed.
There'll normally only be the one route, but as with tracks, it's best to work on the basis that there
may be more than one
Activity
2016-02-20 23:43:42
Note that rtept is of type wptType so as in GPXIN-24 need to consider that extensions may be present
2016-02-21 00:02:38
2016-02-21 00:02:51
2016-02-21 00:08:27
Webhook User-Agent
View Commit
2016-02-21 00:10:43
To handle building the object.
Now need to look at actually pulling the routes out of the GPX file so that they can be processed. They're more like tracks in the way that needs to be handled - there can be multiple routes (some named, but it's not mandatory) and it'll have multiple children.
2016-02-21 00:27:53
Need to add some public methods to allow retrieval of them yet though
2016-02-21 00:27:58
2016-02-21 00:28:19
2016-02-21 00:28:27
Webhook User-Agent
View Commit
2016-02-21 06:26:27
Webhook User-Agent
View Commit
2016-02-21 06:30:55
It's a bit of a sledgehammer approach at the moment, there's no way to extract an individual route point. You'd need to use getRouteByID and then iterate over the points property.
Conversely, there's also no way to extract all routes in one hit either
2016-02-21 06:46:36
2016-02-21 06:46:51
2017-07-04 12:01:13
At the moment you access those by calling getJourneyStats() and then grabbing the attribute routestats but I think it might be helpful to have a utility function that does that for you.
2017-07-04 12:07:30
Webhook User-Agent
View Commit
2017-07-04 12:59:05
2017-07-04 13:11:55
2017-07-04 13:11:55
2017-07-04 13:12:00
2017-07-04 13:25:57
So we need some equivalents
- $gpx->getObject() = $gpx->getRoutesObject()
- $gpx->getTrack('journey0') = $gpx->getRouteByID('name')
- $gpx->getSegment('journey0','seg0') = no equivalent (there isn't really a segment equivalent in routes)
- $gpx->getTrackPoint('journey0','seg0','trackpt0') = $gpx->getRoutePoint('name','trkptname')
We also need equivalents to the ID fetchers - https://www.bentasker.co.uk/documentation/development-programming/222-php-gpx-ingest#IDS
- $gpx->getTrackIDs() = $gpx->getRouteIDs()
- $gpx->getTrackNames() = $gpx->getRouteNames()
- $gpx->getTrackSegmentNames('journey0') = no equivalent
- $gpx->getTrackPointNames('journey0','seg0') = $gpx->getRoutePointNames('name')
For the route related functions that already exist, might want to also create some stub functions so that naming is closer to their track counterparts, though I think there's only one that needs doing:
- getRouteByID() = getRoute()
2017-07-04 13:37:11
The following works as expected
2017-07-04 13:39:30
Webhook User-Agent
View Commit
2017-07-04 13:48:35
And the following works as expected
So that gives us the following public methods
2017-07-04 13:49:30
Webhook User-Agent
View Commit
2017-07-04 13:49:38
2017-07-04 14:28:33
2017-07-04 14:28:40
2017-07-04 14:28:40
2017-07-04 14:28:44