3.1. Basics

This section describes concepts and parameters mutually shared by services. Some of these are standard and defined in OGC specifications while others are very specific to QGIS Server.

Standard concepts:

Concept

Aprašymas

SERVICE

Name of the service

REQUEST

Name of the request

Vendor concepts:

Concept

Aprašymas

MAP

QGIS project file

FILE_NAME

File name of the downloaded file

Short name

Short name definition

3.1.1. SERVICE

This standard parameter allows to specify the name of the service to use for a specific request and has to be formed like SERVICE=NAME.

URL example for the WMS service:

http://localhost/qgisserver?
SERVICE=WMS
&...

Pastaba

Not available for REST based services like WFS3 (OGC API Features).

3.1.2. REQUEST

This standard parameter allows to specify the name of the request to execute for a specific service and has to be formed like REQUEST=RequestName.

URL example for the GetCapabilities request:

http://localhost/qgisserver?
REQUEST=GetCapabilities
&...

Pastaba

Not available for REST based services like WFS3 (OGC API Features).

3.1.3. MAP

This vendor parameter allows to define the QGIS project file to use. It may be an absolute path or a path relative to the location of the server executable qgis_mapserv.fcgi. MAP is mandatory by default because a request needs a QGIS project to actually work. However, the QGIS_PROJECT_FILE environment variable may be used to define a default QGIS project. In this specific case, MAP is no longer a required parameter. For further information you may refer to the Advanced configuration chapter.

URL example:

http://localhost/qgisserver?
MAP=/tmp/QGIS-Training-Data/exercise_data/qgis-server-tutorial-data/world.qgs
&...

3.1.4. FILE_NAME

If this vendor parameter is set, the server response will be sent to the client as a file attachment with the specified file name.

URL example to save an XML GetCapabilities document:

http://localhost/qgisserver?
SERVICE=WMS
&REQUEST=GetCapabilities
&FILE_NAME=wms_capabilities.xml
&...

Pastaba

Not available for REST based services like WFS3 (OGC API Features).

3.1.5. Short name

A number of elements have both a short name and a title. The short name is a text string used for machine-to-machine communication while the title is for the benefit of humans. For example, a dataset might have the descriptive title “Maximum Atmospheric Temperature” and be requested using the abbreviated short name “ATMAX”. You can set title, short name and abstract for:

  • Layers: right-click on a layer and choose Properties… ► QGIS Server ► Description.

  • Groups: right-click on a group and select Set Group WMS data

  • Project: go to Project ► Properties… ► QGIS Server ► Service Capabilities.

../../../_images/set_group_wms_data.png

Fig. 3.1 Set group WMS data dialog

Thus, the short name may be used to identify these items when interacting with QGIS Server. For example with the standard LAYERS parameter:

http://localhost/qgisserver?
SERVICE=WMS
&REQUEST=GetMap
&LAYERS=shortname1,shortname2
&...