The input format was chosen to collect waypoints from the OSM web interface nominatim : http://nominatim.openstreetmap.org/
Compared to adding waypoints from adresses using the QMS "Google" functionality and then manually clicking a route around this waypoints, I see some advantages:
* it hits the points precisely, which you really will appreciate when saving the route to your navi device
* I can refine the position easily in nominatim (eg if OSM just hits the middle of a road, but you know the precise location of your target)
* I can keep the preplanned human readable / editable list for further use
* I can easily play with the list (add / remove / rearrange adresses) and quickly look how the route changes
We use gpsbabel as converter, so we can rely on its wide range of options and its tested capability to produce reasonably conform gpx files (or whatever else you may require).
gpsbabel provides a format option called xcsv , which is able to read quite a range of csv and similiar shaped files.
The details are controlled by a style file, as the the nominatim.style given above.
The file nominatim.style can be used without change, as long as the format of the address list does not change.
If you want to modify it, refer to the gpsbagel pdf Documentation.
the specification for xcsv styles are described in the Appendix there.
To fill the lines of your input route, simply copy/paste the coordinates from the nominatim web page, add a comma, and paste the search address (or whatever description you will attach to the waypoint).
Compare to wpts-test5.csv given above as a format template. Whitespace around the separating comma does not seem to hurt.
and you will yield the output wpts-test5.gpx as shown above as third file. Open it in QMapShack, and you will find your points shown both as waypoints and as ordered route points, connected with straight lines.
Call "calclulate route" and QMapShack will call your router (if properly configured).
Remark: I initially had the plan to have a comma as separator between lat and lon, but something else (like | e.g.) between the coordinates and the adress.
You will notice the tradces of my trial from the lines commented out (#) in nominatim.style .
I did not get it to work. gpsbabel xcsv does not seem to allow the change of delimiters between fields.
So if we use the comma - as we get from pasting the lat,lon pair form nominatim - as delimiter, we must not use further commas within the address.
If we switch to another delimiter, we were required to edit the space between every lat,lon pair, which may easily end up in accidentlial screwing up coordinates.
I tried to convince gpsbabel to accept the lat,lon pair as a single field of type LATLON_HUMAN_READABLE , but obviously, this format does not like the comma as lat-lon separator, either.
We could add some wrapper script (e.g. perl) around the gpsbabel call. but this adds just another layer of complexity and obfuscates the immediate acces to the rich set of available features in gpsbabel.
Well, we could still prepend a transforer scipt (maybe even awk or sed or something like that) to fine tune the formats and still access native gpsbabel options.
Anyway, for me, it is fine to live without commas in the Address.
wrosner
Hang on. Things may get even simpler: We even can forget the style file.
Since after futile trials we are back to simple basic csv format anyway, we do not even need the extended features of xcsv.
Rationale:
provide a way to convert simple human readable / editable text files to gpx for further use e.g. in QMapShack, and/or to send to navigation devices.
See also: https://bitbucket.org/maproom/qmapshack/issues/145/address-lookup-maybe-us-nominatim
The input format was chosen to collect waypoints from the OSM web interface nominatim : http://nominatim.openstreetmap.org/
Compared to adding waypoints from adresses using the QMS "Google" functionality and then manually clicking a route around this waypoints, I see some advantages: * it hits the points precisely, which you really will appreciate when saving the route to your navi device * I can refine the position easily in nominatim (eg if OSM just hits the middle of a road, but you know the precise location of your target) * I can keep the preplanned human readable / editable list for further use * I can easily play with the list (add / remove / rearrange adresses) and quickly look how the route changes
We use gpsbabel as converter, so we can rely on its wide range of options and its tested capability to produce reasonably conform gpx files (or whatever else you may require).
gpsbabel provides a format option called xcsv , which is able to read quite a range of csv and similiar shaped files. The details are controlled by a style file, as the the nominatim.style given above. The file nominatim.style can be used without change, as long as the format of the address list does not change. If you want to modify it, refer to the gpsbagel pdf Documentation. the specification for xcsv styles are described in the Appendix there.
To fill the lines of your input route, simply copy/paste the coordinates from the nominatim web page, add a comma, and paste the search address (or whatever description you will attach to the waypoint). Compare to wpts-test5.csv given above as a format template. Whitespace around the separating comma does not seem to hurt.
Then call gpsbabel like this
and you will yield the output wpts-test5.gpx as shown above as third file. Open it in QMapShack, and you will find your points shown both as waypoints and as ordered route points, connected with straight lines. Call "calclulate route" and QMapShack will call your router (if properly configured).
If you omit the transform extension, like this,
you will have only the waypoints.
If you want to have only the route, without the waypoints, you have to tell gpsbabel to explicitly remove them:
For further options, read the manual you may find here: https://www.gpsbabel.org/htmldoc-1.4.4/gpsbabel-1.4.4.pdf
Remark: I initially had the plan to have a comma as separator between lat and lon, but something else (like | e.g.) between the coordinates and the adress. You will notice the tradces of my trial from the lines commented out (#) in nominatim.style . I did not get it to work. gpsbabel xcsv does not seem to allow the change of delimiters between fields. So if we use the comma - as we get from pasting the lat,lon pair form nominatim - as delimiter, we must not use further commas within the address. If we switch to another delimiter, we were required to edit the space between every lat,lon pair, which may easily end up in accidentlial screwing up coordinates. I tried to convince gpsbabel to accept the lat,lon pair as a single field of type LATLON_HUMAN_READABLE , but obviously, this format does not like the comma as lat-lon separator, either. We could add some wrapper script (e.g. perl) around the gpsbabel call. but this adds just another layer of complexity and obfuscates the immediate acces to the rich set of available features in gpsbabel. Well, we could still prepend a transforer scipt (maybe even awk or sed or something like that) to fine tune the formats and still access native gpsbabel options. Anyway, for me, it is fine to live without commas in the Address.
Hang on. Things may get even simpler: We even can forget the style file.
Since after futile trials we are back to simple basic csv format anyway, we do not even need the extended features of xcsv.
This simplified command will do the same job:.
gives you both waypoints and route. The different -x options apply as above.
Never give up!
Using this little perl script
and this xcsv style
I can even process input as ugly as
using a comand like this
This way we can
unfortunately, it is not that simple any more ....