Michaël DOUCHIN
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
Sessions
Lizmap Web Client is an open-source software allowing to publish web map applications based on QGIS projects.
All layers managed in QGIS can be visualized in Lizmap, and vector layers can also contain information that is worth displaying using charts: bar charts, line graphs, pie charts and tables.
The aim of this workshop is to demonstrate how to create and display plots in the Lizmap interface using vector data (PostgreSQL, FGB, CSV, etc.).
A project with ready-made data will be provided to the participants. We will use weather data from the website https://open-meteo.com/ (Free and open-source weather API).
You can view an example of how Lizmap can display graphs at this address:
https://demo.lizmap.com/lizmap/index.php/view/map?repository=features&project=land_use
In this demo, you can for example select another layer in the left panel (such as "
Postes clés") to see other charts, or choose a municipality in the combo box "Localisation" (top right of the map) to filter the visible charts for a specific municipality.
Workshop schedule:
- Get the QGIS project and publish the first map
- Presentation of the data (municipalities, weather)
- The main principles of data visualisation in Lizmap
- The different types of charts available (bar, pie, polar, histogram, HTML, etc.)
- Creating and publishing charts on the web map
- Filtering charts dynamically
- Viewing filtered charts for the queried feature
- Organizing charts with tabs and groups
- HTML charts for greater flexibility
- Printing using the server-side Dataplotly plugin
In the 15 years since the first lines of code for Lizmap Web Client were written, the web has come a long way: JS frameworks, OpenLayers 3 through 10, WASM, Broadcast Channel, Storage API, WebGL, and more.
Over the past 15 years, Lizmap Web Client — an open-source web mapping application that integrates closely with QGIS Server — has had to evolve, and a new major release is on the horizon.
This presentation will provide an opportunity to showcase the latest features of Lizmap Web Client version 3.10: DXF export, map rotation based on the direction provided by geolocation, the ability to copy and paste an object’s geometry from a map layer during the digitization process, portfolio, and more.
But also to introduce the upcoming version 4 of Lizmap Web Client: removing OpenLayers 2, being able to detach the attribute table while maintaining the link to the map, etc.
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.