Add waypoint recording to Navit
|Reported by:||mvglasow (2)||Owned by:||mvglasow|
|Priority:||minor||Milestone:||want patch / contribution|
This is a new feature I am developing: As of now, I have not found a decent application for creating GPX tracks with waypoints for later use in OSM. There are navigation/tracking applications, which can record tracks but with limited capabilities with regard to starting/stopping without leaving the application, formats supported and support for waypoints. Then there are track logging applications, which do all of the above but do not include a map display (or just a very simple one) - though being able to view current map data is of immense value when visiting a partially mapped area. So why not combine track logging and navigation into a single application?
Design goals are:
- Mechanism to log GPX waypoints through dedicated UI controls (e.g. a "Log waypoint" submenu).
- Timely "commit to disk" to minimize data loss in case of a crash
- Mechanism to start/stop recording of track (menu or OSD item).
- Support for GPX output format (others may be added if considered necessary).
Current implementation status:
- Logging GPX waypoints works; two log entries in the vehicle tag are needed (one for the track, one for the waypoints) since GPX does not allow for alternating recording of trackpoints and waypoints unless the track is split up into segments that terminate at each waypoint (ugly). The only other way would have been to cache waypoint data internally and commit it to disk if the disk is saved, but that would imply the risk of losing all waypoints if Navit crashes and is thus a no-go.
- The only output format supported for waypoints is currently GPX.
- Waypoints are created by calling a function from a menu item (or OSD control); the description of the waypoint is passed as a string and therefore configurable in navit.xml. Default set of waypoints offered is yet to be defined.
- Starting/stopping the log is still to be implemented. My idea is to introduce an attribute called "logging" for the vehicle object. Setting it to nonzero starts all logs associated with the vehicle, setting it to zero stops them. The initial setting will be read from navit.xml, hence adding "logging=yes" to the vehicle tag will automatically start logging.
My idea for the waypoint descriptions is to use a syntax similar to OSM tags rather than prose. E.g. a bus stop would get a description of "highway='bus_stop'" rather than "bus stop". That would allow even for a semi-automated import into an OSM editor (I'm seeing an idea for a new JOSM plugin...)