Extract Node Data from OSM for Garmin POI creation


By way of introduction, I am new to the OSM project and have become involved after finding a link to http://garmin.openstreetmap.nl/ Such an excellent site and many thanks to Lambertus for providing the service. Over the last few weeks I have begun to get familiar with JOSM and Potlatch (Potlatch mainly) for editing and have created a few minor things in my area, fixing what I think is a problem or inaccurate information. I have uploaded a few test traces and even created part of a street in another town that wasn’t there from that trace. Its a fairly steep learning curve but I will get there.

I do quite a bit of long distance travelling on a motorcycle at all hours of the day and night in Australia often in rural and very remote areas. I also belong to a reasonably large group of people who travel vast distances in Australia (for example 1600km per day) and simple things like the availability of 24/7 fuel are a real problem on a motorcycle with a relatively short range (say 320km).

For my own use I have created a list of custom POI’s for many services, when I have surveyed them or researched them in some way, which I use in place of the inaccurate POI’s in the Garmin maps. At least if i plan a trip I KNOW there is 24 hour fuel available at a particular town for example. However I only know about places where I have been not where my companions have been and it strikes me that we could tap the knowledge of these travellers in many ways. OSM is perfect for a repository of that knowledge.

In some research for the POI’s I created I have found some to be off considerably from the co-ordinates supplied by a petroleum company. As an example the greatest variation I have found to date in the advertised location vs the actual location of a petrol station is 541km (which is a problem if you are looking for the service station and your range is only 320km). In fact I also checked the OSM data for this particular site to see if it was there and discovered the same problem for that particular point so I moved it to it’s correct home. No doubt an import was done from the data available at the time which mostly is reasonably accurate but often wildly inaccurate.

I have spent the last day or so researching the Wiki and experimenting with exporting interesting data from the OSM map using osmosis. I have read many many articles on the Wiki about creating POI’s and extracting data from maps but haven’t figured out yet how to do what I want to do to create a POI with further information like full street address, phone number etc.

So for my fuel example I have exported an osm file containing amenity=fuel and then from that created another osm file containing nodes for opening_hours=24/7. When I look at the nodes in these exported maps in josm or potlatch many of them contain further information like address details types of fuel, phone number for example. But when I convert these osm files to gpi, gpx, img using other methods like gpsbabel to read and write the data it doesn’t appear to bring in the the base information like address and phone number when it is actually present in the original node under various keys/tags.

What I haven’t been able to do despite much research is export all the of the information contained in a node (regardless of what it is) to a csv or similar file. If I can do that and then create columns of all the information present on a node then I will be able to manipulate and filter it in any way i want and then use other tools to create a gpx file which has the base address and phone number in it. which will be searchable and dialable from the gps

So after all that is there a way of exporting all information present in a node (regardless of what it is) to a csv file? If I can get around this I may be able to encourage a small army of travellers to review, survey and deposit information into OSM not just POI’s but very relevant highway and other data as well.

I think GPSBabel is a bit limited in terms of handling .osm files. It seems it is only able to read a few specific tags, and will ignore everything else.

For converting from .osm format to CSV or GPX, you could try OSMLib. You can specify which tags are exported, and how the CSV file is formatted etc. Though it can be a bit complicated to setup and use. Probably easiest to install it on Ubuntu. And it helps if you know Ruby to write the conversion rules etc. See http://osmlib.rubyforge.org/ and http://wiki.openstreetmap.org/wiki/OSMLib

Or another option is to import the .osm file into Microsoft Excel. Then you can arrange it into some sort of CSV format.