QGIS Plugin: Desire Lines

Facilitating the creation of flow maps for Transportation Engineering.

Flow Map - Desire Lines

The Problem

In geoprocessing classes for the Transportation Engineering course, there was a major difficulty in using GIS software, as QGIS is not exclusive to the transport sector. Some existing flow tools simply did not work or required old versions of the software.

For a period, I taught the creation of flow maps using SQL programming directly in QGIS. However, being a 3rd-semester course, students faced a steep technical barrier. Since not everyone masters coding, even colleagues and professionals in the field ended up asking for help to solve this common analytical problem (there are even videos on the SQL approach on the channel of my academic project, Mobiliza CEFETMG).

The Solution

Faced with the difficulties of applying the flow map concept in QGIS in a native and accessible way, I decided to develop a dedicated tool. The project became functional on September 28, 2024, and was initially distributed manually via a .ZIP file for installation.

The Desire Lines plugin was created to automate and democratize the generation of desire maps (straight lines connecting origins to destinations). This type of visualization is an essential step for traffic engineering, urban mobility analysis, and strategic planning of public transport networks.

The development was accompanied by publications on Medium to document the process and assist the community:

  • September 16, 2024: Publication of the first article introducing the topic: Do you know what an O-D Matrix is? (Portuguese)
  • September 26, 2024: The project became fully functional, marked by the publication detailing its use: Flow Map in QGIS with DesireLines (Portuguese). Initially, distribution was done manually via .ZIP.
  • May 21, 2026: The plugin was officially approved and included in the official QGIS repository, facilitating direct installation through the software.

Technologies Used

  • Python for the core logic development.
  • PyQGIS (QGIS API) for GUI integration and processing of spatial features.
  • Analytical Methodology based on Transportation Engineering concepts (Origin-Destination Matrices).

Next Steps

The development of the plugin is ongoing. The next mapped improvements are:

  • 1. Incorporate analysis with Delaunay Lines: Implement spatial triangulation algorithms to generate connections and more complex transportation network analyses.
  • 2. Create integrated visual style: Allow users to apply and configure the visual style of the lines (colors, thickness based on demand) directly through the plugin's user interface.
  • 3. Traffic loading filter: Develop a feature to automatically filter and highlight only the routes with the highest traffic volumes, making it easier to read dense maps.