##########################################################################################
GPXIN-24: Waypoint Support
##########################################################################################
Issue Type: New Feature
-----------------------------------------------------------------------------------------
Issue Information
====================
Priority: Major Status: Closed
Resolution: Done (2017-07-04 12:07:42)
Project: PHP GPXIngest (GPXIN)
Reported By: btasker
Assigned To: btasker
Affected Versions:
- 1.03
Targeted for fix in version:
- 1.03
Time Estimate: 35 minutes
Time Logged: 55 minutes
-----------------------------------------------------------------------------------------
Issue Description
==================
Suggested on Github - https://github.com/bentasker/PHP-GPX-Ingest/issues/4
Implement support for Waypoints as defined in the GPX spec.
-----------------------------------------------------------------------------------------
Issue Relations
================
- relates to GPXIN-27: Route Support
- Waypoints (GPX Schema) (http://www.topografix.com/gpx/1/1/#type_wptType)
- FR #4 (https://github.com/bentasker/PHP-GPX-Ingest/issues/4)
-----------------------------------------------------------------------------------------
Activity
==========
-----------------------------------------------------------------------------------------
2016-02-13 09:59:51 btasker
-----------------------------------------------------------------------------------------
Replied with the following on Github:
Could conceivably be added, sure (for reference - relevant part of schema is
http://www.topografix.com/gpx/1/1/#type_wptType ). In fact, it should be fairly
straightforward to drop in as they'll need processing (at ingest) independently of the
trackpoints anyway
I guess you'd then want to be able to do something like
-- BEGIN SNIPPET --
$gpx->listWaypoints();
-- END SNIPPET --
To return all included Waypoints, or
-- BEGIN SNIPPET --
$gpx->getWaypoint($wp-id);
-- END SNIPPET --
To grab by a numerical identifier. Maybe even be able to retrieve by the name specified in
the source GPX?
-- BEGIN SNIPPET --
$gpx->getWaypointByName('foo');
-- END SNIPPET --
Probably also worth adding something to the JSON metadata to indicate whether there are
any waypoints included.
-----------------------------------------------------------------------------------------
2016-02-20 22:12:10 btasker
-----------------------------------------------------------------------------------------
An example GPX file (cobbled together using examples on Cycleseven) might be
-- BEGIN SNIPPET --
Test file by Patrick0.0Position 10.0Position 20.0Position 30.0Position 424-JUL-09DarkRed143.94136.06138.03148.75
-- END SNIPPET --
So, we're going to want to look at creating a new object property to house the waypoints,
and add the various possible attributes
Note that waypoints can have their own extensions (for example)
-- BEGIN SNIPPET --
134.7094727Bettys02-FEB-10 14:10:0602-FEB-10 14:10:06Flag, BlueSymbolAndName
-- END SNIPPET --
So support for those may need to be added later
-----------------------------------------------------------------------------------------
2016-02-20 22:12:58
-----------------------------------------------------------------------------------------
btasker changed status from 'Open' to 'In Progress'
-----------------------------------------------------------------------------------------
2016-02-20 22:38:27 git
-----------------------------------------------------------------------------------------
-- BEGIN QUOTE --
Repo: PHP-GPX-Ingest
Commit: c33637bcbeb75dae8dc783f1ffb555c8e46cea2d
Author: B Tasker >
Date: Sat Feb 20 22:37:38 2016 +0000
Commit Message: Implemented parsing of waypoints for GPXIN-24
Modified (-)(+)
-------
GPXIngest.class.php
-- END QUOTE --
*Webhook User-Agent*
-- BEGIN SNIPPET --
GitHub-Hookshot/21f57ba
-- END SNIPPET --
https://github.com/bentasker/PHP-GPX-Ingest/commit/c33637bcbeb75dae8dc783f1ffb555c8e46cea2d
-----------------------------------------------------------------------------------------
2016-02-20 22:42:03 btasker
-----------------------------------------------------------------------------------------
Have come across a slight hiccup with the implementation so far.
When exporting JSON, we only pass out the _journey_ property (and conversely, only
populate that when reading in from a JSON source). The current implementation adds
waypoints as a completely separate property (as, really, they should be), which means they
won't be included in a JSON dump.
Changing the JSON output so that it no longer solely pushes out _journey_ would change the
structure of the output and break b/c.
Although I don't overly like it as a solution, waypoints (and if they're added at a later
date, route points) should probably be added as a property of _journey_ to ensure they're
included in the JSON output. Perhaps grouped under "related" or similar
-----------------------------------------------------------------------------------------
2016-02-20 22:46:27 git
-----------------------------------------------------------------------------------------
-- BEGIN QUOTE --
Repo: PHP-GPX-Ingest
Commit: 08f22bfff6130c9f6e605670995c14ff29d81226
Author: B Tasker >
Date: Sat Feb 20 22:45:04 2016 +0000
Commit Message: Moved waypoints to being a property of journey. See GPXIN-24
Modified (-)(+)
-------
GPXIngest.class.php
-- END QUOTE --
*Webhook User-Agent*
-- BEGIN SNIPPET --
GitHub-Hookshot/21f57ba
-- END SNIPPET --
https://github.com/bentasker/PHP-GPX-Ingest/commit/08f22bfff6130c9f6e605670995c14ff29d81226
-----------------------------------------------------------------------------------------
2016-02-20 22:53:27 btasker
-----------------------------------------------------------------------------------------
Have added 3 public methods to the class to provide basic handling of waypoints
-- BEGIN SNIPPET --
public function getWayPointCount() // return INT
public function getWaypoints() // return array
public function getWaypoint($id) // return object
-- END SNIPPET --
Where the structure of a waypoint is as follows
-- BEGIN SNIPPET --
gpx->getWayPoint(0)
stdClass Object
(
[name] => Position 1
[description] =>
[comment] =>
[position] => stdClass Object
(
[lat] => 54.9328621088893
[lon] => 9.860624216140083
[ele] => 0.0
[geoidheight] =>
)
[meta] => stdClass Object
(
[time] =>
[magvar] =>
[source] =>
[link] =>
[symbol] =>
[type] =>
[GPS] => stdClass Object
(
[fix] =>
[sat] =>
[hdop] =>
[vdop] =>
[pdop] =>
[ageofdgpsdata] =>
[dgpsid] =>
)
)
)
-- END SNIPPET --
All properties defined within _wptType_ in the spec will always be present in the output,
however if they weren't present in the source they will be null
-----------------------------------------------------------------------------------------
2016-02-20 23:08:00 btasker
-----------------------------------------------------------------------------------------
Have updated the documentation to give details of the current waypoint support -
https://www.bentasker.co.uk/documentation/development-programming/222-php-gpx-ingest#waypoints
-----------------------------------------------------------------------------------------
2016-02-20 23:08:03
-----------------------------------------------------------------------------------------
btasker changed status from 'In Progress' to 'Open'
-----------------------------------------------------------------------------------------
2016-02-20 23:08:32
-----------------------------------------------------------------------------------------
btasker changed timespent from '0 minutes' to '55 minutes'
-----------------------------------------------------------------------------------------
2016-02-20 23:10:52 btasker
-----------------------------------------------------------------------------------------
Latest commit is here -
https://github.com/bentasker/PHP-GPX-Ingest/commit/a1130853a64206bfc7b90e0921c51f09a5f3b021
- forgot to reference this issue
-----------------------------------------------------------------------------------------
2017-07-04 12:07:42
-----------------------------------------------------------------------------------------
btasker changed status from 'Open' to 'Resolved'
-----------------------------------------------------------------------------------------
2017-07-04 12:07:42
-----------------------------------------------------------------------------------------
btasker added 'Done' to resolution
-----------------------------------------------------------------------------------------
2017-07-04 12:07:46
-----------------------------------------------------------------------------------------
btasker changed status from 'Resolved' to 'Closed'
-----------------------------------------------------------------------------------------
Worklog
========
-----------------------------------------------------------------------------------------
2016-02-20 23:08:32 btasker
55 minutes
-----------------------------------------------------------------------------------------
Implementing base support, testing and updating documentation