User:Rorym
| I don't give a flying monkey's for tag voting, automatic changebots, endless discussions, categories, or any of that crap, but prefer to get on and actually do stuff. |
Hi I'm Rorym. I'm currently living in Dublin, Ireland.
Contents |
What I'm working on
Ireland
I'm working on Dublin at the moment.
Africa
I've traveled in Africa and I'm going to trace over some of the cities I've been too. I'm currently working on the Livingstone/Victoria Falls region of Zambia/Zimbabwe, Addis Ababa, Ethiopia and Dar Es Salaam, Tanzania.
My Tags
OpenStreetMap is very free form. I'm going to start using these tags in my mapping. Please use them if you find them useful in order to map our planet.
My Maps
It's possible to tag hackerspaces with leisure=hackerspace. I've made a slippy map showing all the hackerspaces in OSM. It's updated every 6 hours. How it works
My GPS device
I have a NaviGPS BGT-31 from Storage Depot. It's great. :)
Code
Converting an OSM file to a GPX file
When I've collected some traces, I convert them to OSM format and clean them up in JOSM. I break them into logical sections. Although GPSBabel can convert OSM to GPX, the resultant format is unsuitable for upload to OpenStreetMap. This XSLT file will convert an OSM file to GPX:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/osm">
<gpx
version="1.0"
creator="gpsbabel - http://www.gpsbabel.org"
xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"
xmlns="http://www.topografix.com/gpx/1/0"
xsi:schemalocation="http://www.topografix.com/gpx/1/0 http://www.topografix.com/gpx/1/0/gpx.xsd">
<trk>
<trkseg>
<xsl:for-each select="node">
<xsl:sort select="@timestamp" />
<trkpt>
<xsl:attribute name="lat"><xsl:value-of select="@lat" /></xsl:attribute>
<xsl:attribute name="lon"><xsl:value-of select="@lon" /></xsl:attribute>
<time><xsl:value-of select="@timestamp" /></time>
<xsl:if test="./tag[@k='gps:hdop']">
<hdop><xsl:value-of select="./tag[@k='gps:hdop']/@v" /></hdop>
</xsl:if>
<xsl:if test="./tag[@k='gps:vdop']">
<vdop><xsl:value-of select="./tag[@k='gps:vdop']/@v" /></vdop>
</xsl:if>
<xsl:if test="./tag[@k='gps:pdop']">
<pdop><xsl:value-of select="./tag[@k='gps:pdop']/@v" /></pdop>
</xsl:if>
<xsl:if test="./tag[@k='gps:sat']">
<sat><xsl:value-of select="./tag[@k='gps:sat']/@v" /></sat>
</xsl:if>
<xsl:if test="./tag[@k='gps:fix']">
<fix><xsl:value-of select="./tag[@k='gps:fix']/@v" /></fix>
</xsl:if>
</trkpt>
</xsl:for-each>
</trkseg>
</trk>
</gpx>
</xsl:template>
</xsl:stylesheet>
Copy and paste that into a file called osm2gpx.xslt. You can then apply this template to any osm file and get a gpx file out.
Eg:xsltproc osm2gpx.xslt tracks.osm > trackes.gpx