Pages about OpenStreetMap.
Using OpenStreetMap maps with gpsdrive
Here's how I made it:
wget http://download.geofabrik.de/osm/europe/italy.osm.bz2bunzip2 italy.osm.bz2(this might not be needed)- setup mapnik; the instructions for sid worked on my lenny/testing system.
osm2pgsql -c /store/italy.osm(you should not use -m with gpsdrive)- start gpsdrive and turn on mapnik mode. Originally it did not
work for me, until I deleted
~/.gpsdrive/osm.xml.
This makes gpsdrive not only more useful, but also completely Free.
Posted Thu 03 Jul 2008 01:23:25 CESTSaving waypoints with Holux M-241
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)
Playing with a Holux M-241
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:
- http://spreadsheets.google.com/ccc?key=pyCLH-0TdNe-5N-5tBokuOA&t=2046668448833862841
- http://www.rc-cam.com/misc/PMTK_commands.pdf
- http://www.tronico.fi/OH6NT/docs/NMEA0183.pdf
- http://www.sparkfun.com/datasheets/GPS/MTK%20Packet_User%20Manual.pdf
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
Posted Sun 01 Jun 2008 16:46:48 CEST
OpenStreetMap party at Kaohsiung, Taiwan
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!- Previous OpenStreetMap data was collected by only one person, who took the fancy new High Speed Rail from the opposite side of the country and joined the party. This also made discussion about standardising tags for Taiwan rather easy.
- A group of people appeared wielding a number of "totally insane in every regard" Garmin GPSMAP units: it turns out they are with a civil action group that goes around mapping historical trails, abandoned railroads, aboriginal routes and mountain crosses and so on. Apparently, they did not know about OpenStreetMap: hopefully they'll join in.
Technical bits:
The eeePC
was very popular, and very handy for going around storing tracks,
as you can just chuck it in one bag. JOSM runs fine, although it
could really use an interface redesign to fit in the small screen.
In fact, it could really use an interface redesign to fit in the
standard 1024x768 screen of my laptop.- We could not use the tracks made with the Garmins because we did not know we had to do "Setup -> Map -> Lock On Road = Off" and it was on by default. Now we know it for next time.
- Something like a SirfStarIII really helps in a city made mainly of very tall buildings with lots of steel and glass. My Sony-based cheap gps receiver that worked ok in the Bolognese countryside was next to useless here, continously losing the fix and producing a crazy zigzagging track of doom, only useful to figure out big long straight roads.
- Geocorrelation of digital camera pictures rocks! Who needs to store waypoints when you can just take pictures with the digital camera and have them show up as waypoints in JOSM? The trick of taking a picture of the GPS time and use that to compute time offset is great. Also, we found it easier to just fire up gpscorrelate to do the geocorrelation rather than figuring out how the tools in JOSM work.
Issues to address:
- There is a strong need for a
zh_TWtranslation plugin of JOSM; I'll try to find out how to do it and pass on the information to who can do it. - Road names could be written either in English or in Chinese
characters. Currently English has been used for the
nametag 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#osmfor giving me names of people to contact. I will try later after Europe wakes up from this even-earlier-than-usual sunday morning.
Uploading gpsdrive tracks to openstreetmap
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.
Posted Sat 08 Mar 2008 17:12:45 CET