GSoC/GCI Archive
Google Code-in 2013 KDE

Show journey duration for OpenRouteService routing

completed by: Mikhail Ivchenko

mentors: Torsten Rahn, Dennis Nienhüser

Marble is a virtual globe and world atlas — your Swiss army knife for maps. Find your way and explore the world!

Next to the distance of a route the estimated time it takes to reach the destination is an interesting information. Some of the routing backends Marble uses provide this information, but it is not extracted by Marble so far. In this task the estimated journey duration should be extracted in the OpenRouteService plugin and stored in the GeoDataDocument.

  • Open OpenRouteServiceRunner.cpp and notice that the journey time is already parsed and saved as a QTime object in the line QTime time(hours,minutes,seconds,0); This information is not used further however.
  • The name of the route is currently set to "%1%2(OpenRouteService)" some lines below. Change this to become "%1%2|%3|OpenRouteService"  where %3 is a textual description of the journey time. Use "n minutes" for journey shorter than one hour, and "m hours, n minutes" for longer journeys for the textual description.
  • Besides the textual description of the journey length and duration in the description the two values should be included in a GeoDataExtendedData object. This will allow us to use the values further on (e.g. in CloudSync). Create two extended data items for routePlacemark, one "length" with the calculated length of the route (always in meter), and another one "duration" with the extracted duration of the route (using QTime's toString(Qt::ISODate).
  • Configure routing in the Routing Panel to call OpenRouteService only and verify that both long and short routes show up with the intended format. Close Marble and check that ~/.local/share/marble/routing/route.kml has the length and duration of the route saved.

Helpful links: