Here's how I made it:
wget
http://download.geofabrik.de/osm/europe/italy.osm.bz2bunzip2 italy.osm.bz2 (this might not be
needed)osm2pgsql -c /store/italy.osm (you should not use
-m with gpsdrive)~/.gpsdrive/osm.xml.This makes gpsdrive not only more useful, but also completely Free.
The Holux M-241 is a nice unit, but it looks like it cannot store waypoints while you're recording a track.
In fact, if you set it to display latitude and longitude, every time you press enter it stores a track point with the current location. However, after downloading the data with gpsbabel, they are indistinguishable from all the other track points.
If you are not taking a track, this is sufficient: your track will be made by all the waypoints you recorded.
Together with Riccio, another M-241 user, we noticed that if you are taking a track, with one trackpoint per second, then when you press enter in the lat/lon screen you get two track points in the same second: one from the logger, and one from your keypress.
The duplicate timestamp is just enough information to be able to distinguish a waypoint. Here is a little python script that will add a waypoint every time there are two trackpoints with the same timestamp.
#!/usr/bin/python import xml.dom.minidom from xml.dom.minidom import Node import sys def get_text(node): res = "" for n in node.childNodes: if n.nodeType == Node.TEXT_NODE: res += n.data return res.strip() def get_val(node, name): for n in node.childNodes: if n.nodeName == name: return get_text(n) return None doc = xml.dom.minidom.parse(sys.argv[1]) # Scan the document looking for duplicate timestamps wpt = [] last_ts = None for node in doc.getElementsByTagName("trkpt"): ts = get_val(node, "time") if last_ts != None and last_ts == ts: wpt.append(node) last_ts = ts # Add the nodes with duplicate timestamps as waypoints if len(wpt) > 0: for i in wpt: node = doc.createElement("wpt") for a in i.attributes.values(): node.setAttribute(a.name, a.value) for n in i.childNodes: node.appendChild(n.cloneNode(True)) doc.documentElement.appendChild(node) doc.writexml(sys.stdout)
Here is how to download tracks from the Holux M-241:
gpsbabel -t -r -w -i m241 -f /dev/ttyUSB0 -o gpx -F `date +'%Y-%m-%d-%H%M%S'`.gpx
It might work also via bluetooth, but I have not tried yet.
Now, until M-241 support will be released in a stable version of gpsbabel, here is how to compile the version from CVS.
Get the sources:
cvs -d:pserver:anonymous@gpsbabel.cvs.sourceforge.net:/cvsroot/gpsbabel login
cvs -z3 -d:pserver:anonymous@gpsbabel.cvs.sourceforge.net:/cvsroot/gpsbabel co -P gpsbabel
Untar this to debianise the sources.
If it does to compile because of some errors in
lmx.c, apply this
patch.
Then you can install the resulting package and (hopefully) be happy.
Note, after downloading the logs, gpsbabel currently turns on logging. Here is a patch to disable that behaviour.
Finally, if you want to hack around a little on the unit, you can play with mtkbabel: the source code is simple, and most of the MTK protocol is implemented, so you can easily feed your own commands to the MTK. Documentation about the commands can be found here:
The links are taken from a post in the GPSPasSion forum.
For a source of ideas of what commands you can send, you can
look into the source
code of BT747. For example, to set the M-241 to 2Hz fix, you
can add this to mtkbabel:
packet_send('PMTK300,500,0,0,0.0,0.0');
$ret = packet_wait('PMTK001,300,3');
And if you want to set the MTK to an insane 5Hz fix rate, to take really fine grained gpx traces with your laptop, you can use this:
packet_send('PMTK300,200,0,0,0.0,0.0');
$ret = packet_wait('PMTK001,300,3');
Don't forget to set the serial speed to 38400 before talking with the unit:
stty 38400 < /dev/ttyUSB0
Apparently, yesterday we had the first OpenStreetMap event in Taiwan!
We met in a café/restaurant equipped with power plug, wireless network and overhead projector and we had a bit of an introduction, chat and lunch.
Then we split in groups and exploited the fact that the newly built underground (KMRT) system is still free of charge, to spread around and map around the stations.
Finally, we reconvened at someone's house to see how to put the data together, draw roads, tag and upload.
Highlights of the day:
How to turn a
serial GPS into a data logger with 6 hours battery life
. Then attach it to your bike using
magnets from broken hard drives. Totally rocks!Technical bits:
Issues to address:
zh_TW translation
plugin of JOSM; I'll try to find out how to do it and pass on the
information to who can do it.name tag because osmarender cannot render Chinese
characters. There is some planining to create an OSM mirror in
Taiwan which renders twice, and allows to choose the rendering
language for the map. I will try to get a planet.osm
extract for Taiwan that people can use to experiment with this;
thanks to people in #osm for giving me names of people
to contact. I will try later after Europe wakes up from this
even-earlier-than-usual sunday morning.I've got some gpsdrive tracks and my area is blank on openstreetmap.
People pointed me at gpsbabel, and it took me a while to figure how it works. For the record, don't do any of this:
gpsbabel -i gpsdrive -o gpx -f track0000.sav -F track0000.gpx
gpsbabel -i gpsdrive -o gpx track0000.sav track0000.gpx
What you would have to do is this:
gpsbabel -i gpsdrive -f track0000.sav -o gpx -F track0000.gpx
However, it would choke on gpsdrive's "missing" points with all values set to 1001. You can grep them out, then gpsbabel would work, but openstreetmap would reject the data because the points have no timestamp: gpsbabel won't carry that on from the gpsdrive tracks to the GPX tracks.
The way to go is here, which contains a link to a tiny little perl script that will do the proper conversion for you:
./gpsdrive2gpx.pl track0000.sav > track0000.gpx
Those you can upload them to openstreetmap, at last.