Makina Blog

Le blog Makina-corpus

MoodWalkR: behind the scenes


Understanding how MoodWalkR computes pedestrian routes.

I have been working on a pedestrian routing application in the last months. It is called MoodWalkR and I invite you to look at the beta version, available for Toulouse, France. The main principles and motivations that guided me have been:

  • using OpenStreetMap data;
  • allowing a pedestrian to cross an open space;
  • proposing different routes between two points depending on the user profile;
  • keeping the interface really simple.

Routing is performed with PgRouting 2.0 to stay close to the database and geoprocessings. I explain some of the main features in this blog post. 

Different routes according to the user preferences

Trying to understand how I do choose my own routes across the city, I have realised that it depends on the days: I am looking for shops and drinks on the weekdays, cultural or natural places on the weekend, and I even choose the shortest route when I am late to work. I have therefore chosen to create predefined profiles that will lead to computing different routes between the same points.

To achieve that, I use a 50-meter grid over the area. In each cell, about twenty OpenStreetMap features are analyzed, related to environment, transport, commercial activity and culture. They are combined and ponderated to get 3 ratings for each cell : Commercial activity, Nature and Culture. In the map below, you can see the ratings related to natural features.

The road segments can now get 3 fictive lengths, for the 3 different profiles. These lengths are close to the geographical length of the road segment when it crosses cells with low ratings, and they decrease towards 0 when the ratings are high, i.e. near 1. Using a shortest path routing algorithm will so encourage going by cells with high ratings.

Crossing an open-space

Using the main routing applications available, I have always been frustrated not to be able to cross a square in diagonal. No, a pedestrian is not just another vehicle following a road network. To achieve crossing the plazas, I therefore pre-generate visibility graphs on the OpenStreetMap polygons representing pedestrian areas. 

The process is the following and illustrated in the figure below:

  • Step 1: the polygon is simplified by deleting some of its useless points for routing purposes. If an obstacle is inside the polygon, this becomes a hole.
  • Step 2: the visibility graph between all points of the polygon. The are kept only if:
    • they are not outside the polygon;
    • they do not cross the polygon;
    • they are not inside a hole of the polygon.
  • Step 3: only valid routes are then merged with the global routing graph.

Circular routing

In order to help pedestrians to discover their cities, it seems interesting to suggest circular routes, would it be for running or simply walking. This is performed in several steps:

  • Step 1: A random angle is chosen from the starting point. This allows to get new circular routes each time, even from the same starting point.
  • Step 2: A fictive circle whose circumference is equal to the length chosen by the user corrected by a fixed factor is generated, from the starting point and in the the direction of the random angle.
  • Step 3: Three intermediate points are put on the fictive circle and the nearest points on the routing graph are found.
  • Step 4: Four shortest paths between the starting and intermediate points are computed, according to the walkability profile chosen by the user.
  • Step 5: Overlapping sections are removed and the intermediate routes are merged to get the final circular route.

 

Formations associées

Formations SIG / Cartographie

Formation QGIS

Toulouse Du 1 au 3 octobre 2025

Voir la Formation QGIS

Formations SIG / Cartographie

Formation PostGIS

Toulouse Du 22 au 24 octobre 2025

Voir la Formation PostGIS

Formations SIG / Cartographie

Formation Leaflet

Toulouse Du 4 au 5 décembre 2025

Voir la Formation Leaflet

Actualités en lien

Geotrek et OpenS­treet­Map : Mise en place d’une passe­relle pour une connais­sance du terri­toire enri­chie

08/09/2025

Dans l’uni­vers des logi­ciels open-source, les plus belles inno­va­tions naissent souvent de la rencontre entre des commu­nau­tés qui partagent les mêmes valeurs. Aujour­d’hui, nous célé­brons une avan­cée majeure pour Geotrek : la créa­tion d’une passe­relle avec OpenS­treet­Map (OSM), la plus grande base de données carto­gra­phique colla­bo­ra­tive au monde. Plus qu’une simple fonc­tion­na­lité, ce projet est le fruit d’un travail d’in­gé­nie­rie et de recherche appro­fondi.
Voir l'article
Image
Logo d'illustration pour la passerelle entre OSM et Geotrek

Instal­ler Geotrek : avec ou sans segmen­ta­tion dyna­mique ?

08/09/2025

Geotrek-admin propose deux modes de fonc­tion­ne­ment pour gérer les objets liés aux tronçons : avec ou sans segmen­ta­tion dyna­mique. Ce choix a un impact impor­tant sur la manière dont sont stockées et gérées les données, et sur les possi­bi­li­tés d’édi­tion, de cohé­rence topo­lo­gique et d’in­ter­opé­ra­bi­lité avec d’autres systèmes. Dans cet article, on vous explique ce qu’est la segmen­ta­tion dyna­mique ainsi que le réfé­ren­ce­ment linéaire, ses avan­tages, ses limites, et dans quels cas il est perti­nent (ou non) de les utili­ser.
Voir l'article
Image
Réseau de tronçons dans Geotrek

Makina Corpus spon­so­rise State of the Map 2025

05/06/2025

Du 13 au 15 juin 2025 à Tours, Makina Corpus a le plai­sir d’an­non­cer sa parti­ci­pa­tion à State of the Map 2025 et d’ap­por­ter son soutien à l’évé­ne­ment de la commu­nauté OpenS­treet­Map en le spon­so­ri­sant.
Voir l'article
Image
State of the Map Tours

Inscription à la newsletter

Nous vous avons convaincus