Managing waypoints with OSM
I had from the beginning of using OSM the idea to use it for managing waypoints.
I had some success and would like to share this information here.
My use case is to upload and store my way points in OSM and then later before going to an area download the latest update on my GPS device.
By using the XAPI it is very simple to download all nodes of a certain area with a command such as
wget http://www.informationfreeway.org/api/0.6/node[bbox=9.9764,44.3644,10.072,44.4748] -O osmdata.xml
This will download all the nodes in a given bounding box. But typically this gives far to much nodes, because it contains all the nodes of all ways, boundaries and so on. So a predicate need to be used to limit the type of nodes. There are quite complex combination of predicates possible, but I think a simple predicate which only takes nodes with a name tag works for most cases. So the API call becomes:
wget http://www.informationfreeway.org/api/0.6/node[bbox=9.9764,44.3644,10.0722,44.4748][name=*] -O osmdata.xml
alternative this predicat can be used "/api/0.6/node[not(way)]" (for wget the braces need to be escaped). This return all nodes which do not belong to a way
The next step is to convert this osm file to GPX. Gpsbabel can do that.
For any GPS
We just need to choose "OpenStreetMap data files (.xml)" as input format and GPX as output format. It is probably important to let gpsbabel shorten the name to the maximum name the GPS supports. This could become a problem, in case the nodes are named as "Mount ...", because Gpsbabel probably just cuts the name after x letters. Maybe this problem could be solved by introducing a new tag "short_name" for this case, tag all interesting nodes in OSM with it and introduce a pre-processing step to replace in the
<tag k='name' v='Monte Scala'/>
XML the value with the one form the "short_name" tag.
For Garmin with POI support
For the newer Garmin GPS exists an alternative. For those Gpsbabel can create a cvs file (format="Garmin POI database") which can be uploaded to the Garmin. For this a tool called poiLoader is used. The POI format allows apart of other things more characters for the name. Gpsbabel puts as well the OSM id as the description of the node.
- For certain non-node OSM objects it might be interesting to convert them to GPS waypoints as well to have them as waypoints or POIs in the GPS device. This could be things such as
- places (villages, hamlets)
- other places which people might map as an area, even that for hiking purposes a single point would be good enough. This could be areas such as
Making a tool which does that by calculating the "center" of an area and creating a node for this, should not be too difficult.