OGC Web Map Service¶
http://opengeospatial.org/standards/wms
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)
Note
How does the server and the client communicate
Client sends the request encoded in URL to some known server address. Example of WMS endpoint:
http://my.maps-domain.org/wms
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:
http://my.maps-domain.org/wms?parameter1=value1¶meter2=value2&...
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¶
Open Project properties dialog and go to OWS Server tab
Click Service capabilities checkbox and fill needed items
Select all vector layers for OGC WFS and raster layers for OGC WCS services
Launch test configuration
Save the project as file next to the `publication-data` directory
Copy publication-data along with the QGIS project file to /mnt/publish/YOUR_NAME/ directory
Let’s open our created QGIS project with raster and vector data!
In our case, the OGC OWS server is living in GIS.Lab server instance
We have to point the qgis_mapserver.fcgi program to our project - we have to add map parameter to the URL
map=cepicky/ISPRS_summerschool_ospublication.qgs
Now we can ask for metadata from the server:
service=wms request=getcapabilities
Each request parameter is to be separated in form:
key=value
Parameters are separated using & sign.
All parameters are separated from the file name using ? sign:
http://147.32.26.113:91/cgi-bin/qgis_mapserv.fcgi? map=cepicky/ISPRS_summerschool_ospublication.qgs& service=wms& request=getcapabilities
Putting it to one line
Now we can get the map
What have we done?¶
Load Published WMS service to QGIS¶
Note
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.
In QGIS, you can now add new WMS server
Connect to the server and select some layer, choose PNG image format, create name
Now you may have to see a new raster layer, published from our WMS server