Understanding the WMS and WFS geoservices (Part 2)

GetCapabilities

The GetCapabilities operation is a request to a WFS server for a list of operations and services, or capabilities, supported by that server. When you establish a connection with QGis, for example, on a WFS server, QGis sends this request to be able to manage the connection and offer you the uploading of the different available layers.

The request takes the following form:

localhost: 8080 / geoserver / wfs?
wfs & service =
& version = 1.1.0
request = GetCapabilities

The answer to GetCapabilities is a long XML document.  

A GetCapabilities document has five main elements:

ServiceIdentification contains basic information about the request header, such as the title and type of service. The ServiceType indicates which versions of WFS are supported.
ServiceProvider Provides contact information for the company that publishes the WFS service, including phone, website, and email.
OperationsMetadata Describes the operations supported by the WFS server and the parameters of each operation. A WFS server can be configured so as not responding to the operations listed above.
FeatureTypeList layers are listed in the namespace form: featuretype. The default projection is also shown, with the footprint box for the data in the projection indicated.
Filter_Capabilities A list of filters, or expressions, that are available to query, for example, spatial operators (such as Equals, Keys) and comparison operators (such as lessthan, greaterthan). The filters themselves are not included in the GetCapabilities document.


DescribeFeatureType

DescribeFeatureType requests information on a particular layer before requesting the actual data. Specifically, the operation will request a list of features and attributes for the given layer, or list the types of available features.

The request takes the following form:

l ocalhost: 8080 / geoserver / wfs?
wfs & service =
& version = 2.0.0
request = & DescribeFeatureType
typeNames = topp: tasmania_roads &
outputFormat = text / javascript

The answer will be of the following type:

In this example the answer indicates that the tasmanbialayer_roads has two attributes: the_geom of polyline type and TYPE of string type.


GetFeature

The GetFeature operation returns a selection of entities from the data source.

The request takes the following form:

localhost: 8080 / geoserver / wfs?
wfs & service =
& version = 2.0.0
request = & GetFeature
typeNames = topp: tasmania_roads &
FEATUREID = tasmania_roads.1 &
outputFormat = text / javascript

This request asks for an entity of the tasmania_roads layer having as identifier tasmania_roads.1 The answer is:  

We observe the values ​​of the coordinates of the polyline and the value of TYPE for this entity: alley .

The WMS protocol

The Web Map Service Interface (WMS) provides a simple HTTP interface for requesting geo-recorded map images from one or more geospatial databases distributed. A WMS request defines the geographic layer (s) and the area of ​​interest to be processed. The response to the request is one or more geo-recorded map images (returned as JPEG, PNG, etc.) that can be displayed in a browser application. The interface also allows you to specify whether the returned images should be transparent so that multiple server layers can be combined or not.

A typical GETMAP query is of the following form:

localhost: 8080 / geoserver / topp / wms?
service = WMS &
& version = 1.1.0
request = GetMap &
layers = topp: tasmania_roads &
bbox = 145.19754% 2C-43.423512% 40.852802 2C148.27298000000002% 2C-&
width = 768 &
height = 641 &
srs = EPSG: 4326 &
format = image / png

The layers parameter indicates which layer you want, the bbox parameter indicates the desired geographic site and the parameter srs whose coordinate system is requested.

The width and height parameters indicate the exact pixel size of the returned image from this query, while the format indicates the desired image format. This information is essential because the output of the request will be an image that will be loaded directly into a map window:

The size of the image will be the size of the map window and, therefore, this image is superimposed on the other information of the window, the corners of the image must correspond exactly with the current coordinates of the window. In order to make a comparison with the WFS protocol, here is the output of the query requesting the set of entities of the same layer (tasmania_roads):  

Both results are based on the same data layer of the server, but while the image is directly usable in a browser, the data will have to be processed by computer code to be displayed.

Si cet article vous a intéressé et que vous pensez qu'il pourrait bénéficier à d'autres personnes, n'hésitez pas à le partager sur vos réseaux sociaux en utilisant les boutons ci-dessous. Votre partage est apprécié !

Leave a Reply

Your email address will not be published. Required fields are marked *