KDE

Use JSON instead of XML in the Marble CycleStreets Routing Plugin

Welcome to Marble, a virtual globe and world atlas that runs on Linux, Windows, MacOS and Android. Find your way and explore the world! :-)

To complete this task you need a Marble development environment. Do one of these tasks to set it up:

  • Setup a Marble development environment on Linux
  • Setup a Marble dev environment on Windows

Marble supports routing and uses so-called backends to calculate routes. For bicycle routing, there is a CycleStreets plugin that queries cyclestreets.net. Its new API supports JSON output as an alternative to XML. This task is about switching the Marble CycleStreets plugin from XML to JSON parsing.

  • Run Marble (bin/marble-qt), open the Routing panel. Change the profile to Bicycle, and use the Settings button to configure the backends. Choose CycleStreets as the only backend. Go to London and plan a route there (e.g. right-click on the map, Directions from Here). The route should be shown in blue now on top of the map. The drop-down menu below the instructions in the Routing panel should end with '(CS)' indicating that the CycleStreets backend was used.
  • Change CycleStreetsRunner.cpp to retrieve JSON routes instead of XML (see also the API), and change the parse() method to interpret JSON.
  • Make use of &reporterrors=1 as well
  • Test that the changed plugin still works like before

When you are done, please upload your code changes in a review request to phabricator.

Got a question or a problem you cannot solve on your own? Please contact your mentors.

Task tags

  • qt
  • routing
  • marble

Students who completed this task

Sergey Popov

Task type

  • code Code
close

2016