[OSM-dev] Export of GPX data ("planet.gpx")

Lars Francke lars.francke at gmail.com
Sun Dec 27 05:01:58 GMT 2009


Okay I'm partly done (will upload it to bitbucket in the next few
days). I just copied and pasted a lot of stuff from the program that
dumps the history data for OSM.

The format for the metadata XML is currently something like this:

<gpxFiles generator="OpenStreetMap PlanetGpxDump.java"
timestamp="2009-12-27T23:55:00Z">
  <gpxFile id="12345" timestamp="2006-03-21T09:33:03Z"
fileName="foobar.gpx" points="2143" startLatitude="10.1234567"
startLongitude="53.1234567" user="Foo" uid="12345"
visibility="identifiable">
    <description>Description</description>
    <tag>barfoo</tag"
    <tag>fooooobar</tag>
 </gpxFile>
</gpxFiles>

* I don't really care if I use attributes[1] for the tags or write it
in the element body as above so if anyone has an opinion about this
let me know and I'll gladly change it.

* For "Public" traces I would omit the user and uid attributes

* I only include inserted and visible files. I assume that "inserted"
means that the file has been processed and the individual points have
been inserted?

* As per short discussion on IRC I write a second, plain-text, file
that just includes one fileNames one each line so it can easily be
used with tar --from-file (or something else) to compile the final
package

* I ignore the data_public flag for users - that was before my time so
I don't really know if this flag was supposed to cover GPX files too
but I assumed not because of the possibility to set visibility on a
per GPX basis

* Start latitude and longitude are saved as doubles for GPX files
(opposed to ints for nodes) but I treat them the same with seven digit
precision. Is that okay?


I think I will do some work to include "Trackable" and "Private"
traces too (anonymized of course). That means that I'd have to write
custom GPX files.

* I currently use the id as the file name (just as for all the other
traces). If the id shouldn't be revealed I can generate some other
value but I figured that'd be security by obscurity and deemed it
unnecessary

* How would you prefer the output/how are GPX files saved on the
server? Should I compress them and if yes which compression algorithm.
Or should I write a second plain-text files with all generated GPX
files so you can process them yourself?

* Which metadata to write? id(?), points and visibility can safely be
shared. startLatitude, startLongitude and timestamp only for
"Trackable"?


This would mean the following for the XML elements:
Identifiable:  <gpxFile id="12345" timestamp="2006-03-21T09:33:03Z"
fileName="foobar.gpx" points="2143" startLatitude="10.1234567"
startLongitude="53.1234567" user="Foo" uid="12345"
visibility="identifiable">
Public:  <gpxFile id="12346" timestamp="2006-03-21T09:33:03Z"
fileName="foobar.gpx" points="2143" startLatitude="10.1234567"
startLongitude="53.1234567" visibility="public">
Trackable: <gpxFile id="12347" timestamp="2006-03-21T09:33:03Z"
points="2143" startLatitude="10.1234567" startLongitude="53.1234567"
visibility="trackable"/> & no Tags or Description
Private: <gpxFile id="12348" points="2143" visibility="private"/> & no
Tags or Description

Cheers,
Lars

[1] <tag name="barfoo"/> | <gpxFile [...] description="Description">




More information about the dev mailing list