Managing a topological county road 🚗 network: linear referencing with QGIS & PostGIS
2026-10-06 , Bridge 2

We used QGIS combined with the capabilities of PostGIS to create a plugin allowing to visualize and edit topological road network data with linear referencing capabilities.

The data is stored in a PostgreSQL database, and trigger functions are used to:
* Automatically populate certain fields (creation date, modification date, length, etc.)
* Respect topological rules (segments, nodes, connections, etc.)
* Automate certain tasks: automatically split roads at intersections, automatically create upstream and downstream nodes for segments, etc.

PostgreSQL functions are also used for linear referencing calculations: to determine the reference marker ID (“PR”), the curvilinear abscissa, the distance to the road (right or left). For example, “D809 PR 2+135, side G, offset 3.4 m” for a point on the map.

In QGIS, we have enabled the advanced editing options in the project properties to facilitate digitizing, including automatic transaction groups that allow users to immediately see how entering a feature affects other layers (clipping, moving, etc.). This allows users to see the results of the database calculations right away without having to save their edits.

We also made full use of QGIS's capabilities for interacting with the database:
* Advanced search by adding an item to QGIS's global search tool (shortcut “CTRL+K”) that automatically zooms in on a specific location using an address in the format “[road code] [marker] [abscissa]”
* Real-time display of references when hovering over a road via a toolbar button. When enabled, a query corresponding to the mouse coordinates is launched, and the database response is displayed
* Python actions for certain layers to initiate processing on an object. For example, a right-click allows you to finalize the creation of a roundabout based on the digitization of a circle at the intersection of road segments.

Of course, QGIS’s editing forms also ensure that attributes are edited correctly across different tables, particularly through expression constraints and advanced tools that provide drop-down lists, checkboxes, the ability to select a parent segment by clicking on the map (the “Relationship Reference” tool), and so on.

For the tool’s more complex functions, we created algorithms for the QGIS Processing toolbox: creating the structure (tables, functions), importing data, copying data into an editing sandbox, and validating that data.

In this presentation, we will demonstrate how QGIS addresses a complex business challenge while serving as a robust interface to a PostgreSQL database.

QGIS and PostgreSQL lover for 20 years
Co-inventor of Lizmap Web Client.

I live in Montpellier, France and love tennis 🎾 and hiking 🥾
I work for 3Liz company

This speaker also appears in: