This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Beginners guide to logging a journey with open source structures

0

hi,

i want to start working with gps data to create routes and build maps of my journeys for blogs, travelogues, etc. i also want to create future journeys for planning (i suppose like itineraries)...

i know a journey consists of trackpoints, so that a very simple record of journey may look (in principle) like::

<journey>
<trackpoint>
 <lat>x</lat>
 <long>y</long>
 <alt>z</alt>
 <timestamp>
   <date>yyyymmdd</date>
   <time>hh:mm:ss.xxx</time>
 </timestamp>
</trackpoint>
<trackpoint>
 <lat>x</lat>
 <long>y</long>
 <alt>z</alt>
 <timestamp>
   <date>yyyymmdd</date>
   <time>hh:mm:ss.xxx</time>
 </timestamp>
</trackpoint>
   ......
</journey>

i appreciate also i may have to translate co-ords from different formats, and time from utc(or maybe just leave as utc), but what i cannot find is a basics howto that starts at this simple level and builds from there, showing me the correct standard structure to use.

i want at start to be able to represent my journeys in gpx, kml, osm_xml formats, so i want to know hot to take the raw data and translate it into these formats e.g. via an api:

gpx_file.gpx = journey.get_gpx(raw_journey_data)

osm_file.gpx = journey.get_osm(raw_journey_data)

obviously, then i need to understand these standards.

i have tried reading around, but there is so much about getting data out from a map, and i can't find a good 'basics' guide to plotting a diary event {ie a journey over a set time}... help?...

thanks,

iain

asked 27 Oct '13, 14:09

iainmacgigamac's gravatar image

iainmacgigamac
11112
accept rate: 0%

edited 27 Oct '13, 15:55

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554


3 Answers:

1

OSRM, the most popular routing software for OSM data, allows you to export a GPX file from a planned journey. You could then write a script in the programming language of your choice to add the additional data you're talking about.

answered 21 Nov '13, 16:33

Richard's gravatar image

Richard ♦
30.9k44279412
accept rate: 18%

0

I highly recommend to use a manual solution ("drawing by hand") to do journey planing
https://wiki.openstreetmap.org/wiki/Maps
This is still not a usecase that is currently well supported, but cause a lot of manual processing and a lot of tools:

  1. Create .GPX files using a custom script or what ever fits best
  2. You need a tool/service that supports input a GPX track and does a routing that creates a route along the track for the right vehicle. Otherwise you might manually create via points
    https://wiki.openstreetmap.org/wiki/Software/Desktop#Navigating_features ("follow predefined track")
    https://wiki.openstreetmap.org/wiki/Routing/online_routers
  3. Get from the directions the OSM ids from the routing graph.
  4. Download OSM data in the area, match IDs and create a map style with highlighting this features

answered 21 Nov '13, 16:25

iii's gravatar image

iii
4.9k84082
accept rate: 10%

0

I can't speak to displaying routes, but I may have some partial answers.

For converting your .gpx files into other formats I would recommend GPSBabel (http://www.gpsbabel.org/) which seems to speak just about every GPS format in the world. For complicated operations the documentation can be rather opaque, but for simple things it's easy enough to use. It's primarily a command line utility, so it shouldn't be difficult to call it from whatever you're planning on writing. You seem mostly interested in writing your own utilities, but you might not need to reinvent the wheel.

As far as planned gpx routes go, other than the things already mentioned in other answers, I do know that OSMAnd can save GPX out gpx routes based on what it uses for navigation.

answered 20 Dec '13, 14:45

InsertUser's gravatar image

InsertUser
11.0k1369185
accept rate: 19%

Source code available on GitHub .