Some kid road network carpet

A while ago, Champs-Libres worked on a project on street light measurements. The goal of the project was to prepare the surveying of a network of streets where a car equipped with light sensors will pass in every street of the network, and even in every lane of streets, to measure the brightness of the streetlights. This is the so-called Chinese Postman Problem: how to optimally pass in all segments of a network and account for the different number of lanes for each segment. Surveys are happening during the night and thus keeping track of the navigation on every lane of the network (did we pass on this lane already?) is challenging! To meet this challenge, the idea was to develop a navigation app that explicitly shows the number of lanes of a road network.

For determining the number of lanes we resorted to OpenStreetMap (OSM) data. Here either the number of lanes is tagged or can be inferred from the street type. But the most fun part was to actually render the number of lanes on a navigation application so that the surveyor can check whether he/she passed in every lane of the street. The goal was thus to have a navigation application with a customised map style and possibly with custom data.

We had the intuition that OsmAnd, the most known navigation app in the OSM community, was a good candidate and indeed it met the requirements perfectly! OsmAnd is maybe not the most easy-to-use navigation and mapping app, but it is definitely a very complete and professional one. By the way, it is also Champs-Libres’ preferred application for car navigation, hiking and (long-trip) cycling. Not only is the source code of OsmAnd open, but the app offers a lot of customisation possibilities without the need to compile the app.

And so we did! Following the documentation on making our own rendering we first produced our own “obf” files (the format for geographic data in OsmAnd) using OsmAndMapCreator. Then we designed our custom rendering that shows the number of lanes and finally we transferred the map data and the map style to a mobile device with OsmAnd.

Custom data for OsmAnd

Producing the “obf” file was needed because the number of lanes on the road is not present by default. Aside from that it also offered us full control over the data which was useful in case we wanted to edit the road data before using it in OsmAnd. Also, only the road network is used and shown in OsmAnd: all other map features (buildings, shops, POIs, …) were excluded. All the process of preparing the data was done in a QGIS plugin that shipped the OsmAndMapCreator software. The user just has to choose a road network using the QGIS plugin and then transfer the road data with lanes to a device with OsmAnd.

… and then there is the custom map style

OsmAnd screenshot with custom lane navigation

To reveal the number of lanes on the map we developed a special OsmAnd map style based on the default one. We only focused on the road rendering, with these specific adaptations:

  • account for the number of lanes in the data and render these lanes;
  • increase the width for all roads, for every zoom level;
  • same colour for all kinds of roads;
  • display arrows for oneway roads.

Lastly, the OsmAnd app was fully configured for the surveying: displaying and preloading some satellite imagery background, increasing the rate of GPS data acquisition, configuration of the screen, etc. All these adjustments made our process of working with OsmAnd easier. This project demonstrated how an open-source app can be customised to meet really specific requirements in terms of map navigation.

OsmAnd is developed by a company from the Netherlands with an East Europe team. We found the documentation on the OsmAnd website and repository written well enough to develop this project without contacting the OsmAnd team. Finally, almost 2 years later, we met the OsmAnd developers team at the State-of-the-Map conference in Antwerpen and told them about this project. We had a good time with them and the next time we’ll work on OsmAnd, we will surely contact them in advance! Do not hesitate to use, customise or even fork OsmAnd for your application!