OGC Web Map Service


Publish map images from data stored on server to the client.

Parameters for the map:

  • Image size
  • Required layers
  • Area extent
  • Image format
  • Coordinate reference system
  • (Layer style)


How does the server and the client communicate

Client sends the request encoded in URL to some known server address. Example of WMS endpoint:


The parameters for the request are stored at the end of the URL starting by ? sign. Each parameter and it’s value are separated with & sign:


The response from the server is either data itself (like PNG or JPEG image) or XML-encoded document

WMS Server should be able to handle 3 types of requests:

  • GetCapabilities - retrieves server metadata (encoded as XML document)
  • GetMap - retrieves PNG or JPEG image
  • GetFeatureInfo - allows the client ask for attribute data identified by “mouse click” - single point

QGIS project deployment

  1. Open Project properties dialog and go to OWS Server tab

  2. Click Service capabilities checkbox and fill needed items


    Fig. 71 Fill short name, title, organisation, … WMS Capabilities: click Use Current Canvas Extent. Add supported CRSs.

  3. Select all vector layers for OGC WFS and raster layers for OGC WCS services


    Fig. 72 Enable WFS and WCS layers, you can limit image size for WMS too.

  4. Launch test configuration


    Fig. 73 Launch test configuration.

  5. Save the project as file next to the `publication-data` directory

  6. Copy publication-data along with the QGIS project file to /mnt/publish/YOUR_NAME/ directory

  7. Let’s open our created QGIS project with raster and vector data!

  8. In our case, the OGC OWS server is living in GIS.Lab server instance

  9. We have to point the qgis_mapserver.fcgi program to our project - we have to add map parameter to the URL


  10. Now we can ask for metadata from the server:


    Each request parameter is to be separated in form:


    Parameters are separated using & sign.

    All parameters are separated from the file name using ? sign:

    Putting it to one line

  11. Now we can get the map,5.44521e+06,539858,5.45313e+06


What have we done?


Fig. 74 Deploying of the project

Load Published WMS service to QGIS


It’s worth to start a new empty QGIS project for this step to avoid confusion by all the layers you may have in the layer switcher.

  1. In QGIS, you can now add new WMS server


    Fig. 75 Add new WMS layer - New server with URL The rest of parameters leave untouched.

  2. Connect to the server and select some layer, choose PNG image format, create name

  3. Now you may have to see a new raster layer, published from our WMS server