Configuration

The plugin is set with environment variables of QGIS Server (or py-qgis-server). All of them are optional.

Variable

Default

Meaning

ELEVATIONPROFILE_COPERNICUS

1

0 disables the Copernicus source.

ELEVATIONPROFILE_COPERNICUS_URL

public tiles (AWS)

URL template of the tiles ({name}: tile name), e.g. for a local mirror.

ELEVATIONPROFILE_COPERNICUS_CACHE_DIR

~/.cache/elevationprofile-copernicus

Folder of the Copernicus disk cache.

ELEVATIONPROFILE_COPERNICUS_CACHE_MB

2048

Maximum size of the cache, in MB (0: no cache).

ELEVATIONPROFILE_MAX_SAMPLES

2000

Maximum number of points of a profile.

The default URL of the Copernicus tiles is https://copernicus-dem-30m.s3.amazonaws.com/{name}/{name}.tif.

Where to set them?

  • py-qgis-server: in the environment of the service (.env file, systemd unit, docker-compose.yml…).

  • QGIS Server as FastCGI: in the web server configuration, e.g. fastcgi_param (nginx) or FcgidInitialEnv (Apache).

Example for a systemd unit:

[Service]
Environment=ELEVATIONPROFILE_COPERNICUS_CACHE_DIR=/var/cache/elevationprofile
Environment=ELEVATIONPROFILE_COPERNICUS_CACHE_MB=4096

Restart QGIS Server after a change.

Proxy

If QGIS Server reaches the Internet through a proxy, set GDAL_HTTP_PROXY (and if needed GDAL_HTTP_PROXYUSERPWD): Copernicus is read by GDAL.

Logs

The messages of the plugin are written in the QGIS Server logs, under the name Elevation Profile Server, with the X-Request-ID header of the request when it is given. Each Copernicus read is logged with its duration and where its blocks came from, e.g.:

Copernicus: 537 points, 2 blocks (1 from the disk cache, 1 downloaded) in 1.35 s