How it works

Who does what

The path of the requests: the browser never queries QGIS Server directly

The path of the requests: the browser never queries QGIS Server directly.

browser ──> Lizmap: index.php/elevationprofile/service   (this module)
              │  checks the access to the project, as the map does
              │  adds the user identity (X-Lizmap-User…)
              v
           QGIS Server ── Elevation Profile Server plugin ──> JSON
              │  layer rights (lizmap_server)
              │  layers excluded from the WMS left out
  • The browser shows the tool: drawing the lines, list of the layers, graph.

  • The module relays the two requests of the tool (GetElevationLayers and GetElevationProfile) to QGIS Server, with the request classes of Lizmap: same QGIS Server URL, same project, same user headers as the map. It passes on only the parameters of the tool (LAYERS, LAYER, GEOMETRY, CRS, SAMPLES).

  • The QGIS Server plugin lists the elevation layers the user may read and computes the profiles (see its documentation for the details of the requests).

Why a module?

The browser cannot query QGIS Server directly: with Lizmap, QGIS Server must stay private, and only Lizmap knows who the user is. But the Lizmap proxy only relays the WMS, WFS and WMTS requests it knows. The module thus adds its own relay, with the same checks.

The same tool as the fork

The code of the tool (map module and display component) is the one of the fork Seboon/lizmap-web-client, taken as is. Only the way it is shown changes: in the bottom dock of Lizmap, instead of a dockable window of the Measure menu. The module uses the OpenLayers and the Plotly of Lizmap: nothing is loaded twice.

Computing the profile

  • The project layers are requested first (fast), then the online sources (slower), at the same points: the curves are exactly superposed.

  • The sampling step is the pixel size of the finest layer, within the limit set by QGIS Server (2000 points by default).

  • The distances are measured along the line: planar in a metric projection, on the ellipsoid in geographic coordinates and in Pseudo-Mercator.

The project layers are shown first; Copernicus follows, computed at the same points

The project layers are shown first; Copernicus follows, computed at the same points.