GetCapabilities Responses |
When calling a WMS service, WMS will return a response containing service metadata formats for the GetCapabilities request, and this response is based on WMS Capabilities XML schema.
WMS Capabilities XML mainly contains two components of Service and Capability.
Contents in the <Service> element in WMS Capabilities XML represent general service metadata, and this element provides an integral description of server general metadata. This data contains Name, Title and Online Resource URL elements, as well as some optional contents: Abstract, KeywordList, ContactInformation, Fees, AccessConstraints and LayerLimit elements.
Table 1 Elements of general service metadata
Element name | Description |
Name | Names of WMS services. |
Title |
Titles of services. Brief descriptions of the server, depending on server providers, distinguishable from other servers. |
Abstract |
Abstracts of services. Provides more descriptions on the server information. |
OnlineResource |
Online resources. Provides website references of service providers. Other OnlineResource elements are URL prefixes of each operation. |
KeywordList|Keyword |
Keywords. The server as a whole, can help directory searches. |
ContactInformation |
Contact information. Should contain this element. |
LayerLimit |
Layer limit number. This element value is a positive integer, representing maximum layer number that the client is permitted to request in a single GetMap request. If this element does not exist, the server default is no limit. |
MaxWidth & MaxHeight |
Maximum width and height. Values of these two elements are positive integers, representing maximum width and height of pictures that the client can request in a single GetMap request. If no value exists, the server default is no limit. |
Fees |
Fees. If there are no application fees on the server, this element can be ignored. If using this element, "none" (case insensitive) represents free, such as "<Fees>none</Fees>". |
AccessConstraints |
Access constraints. If the server does not use access constraints, this element can be ignored. If using this element, "none" (case insensitive) represents no access constraints, such as "<AccessConstraints>none</AccessConstraints>". If using this element and contents of this element have no accurate grammar definition, the client can display user information and behavior contents. |
Contents in the <Capability> element represent requests supported by the server (GetCapabilities, GetMap or GetFeatureInfo), output formats of each kind of operation, and URL prefixes of each operation. XML schema contains not only the HTTP distributed computing platform (DCP), but it also defines the HTTP platform at present.
In addition, the <Capability> element specifies information such as exception formats, layers, etc.
In WMS service metadata, the majority are layer information. Geographic information contents provided by the WMS server are organized in layers.
Nested subelements of the <Layer> element represent attribute information of layers.
Table 2 Layer properties
Element name | Whether it is required | Description |
Title |
Optional |
Titles of layers. Cannot be inherited by child layers. |
Name |
Mandatory |
Layer names. If a layer has only one <Name> element, then Name can be used as the value of LAYERS parameter in the GetMap request. The cient will not request a layer only with Title but without Name. If the client requests an invalid layer, the WMS server will throw a service exception (code="LayerNotDefined"). Name cannot be inherited by child layers. |
Abstract |
Mandatory |
Abstracts of layers. Provides more detailed descriptions on layers. Abstract cannot be inherited by child layers. |
KeywordList |
Mandatory |
Keyword lists. KeywordList contains zero <Keyword> element or several <Keyword> elements that can help directory searches. KeywordList cannot be inherited by child layers. |
Style |
Mandatory |
Styles of layers. Zero or several <Style> are used to represent styles of a single layer or a layer collection. Each Style contains <Name>and<Title> elements. Name is used to set the STYLES parameter in the GetMap request. Style may also contain other elements. <Abstract> provides descriptions of styles, and <LegendURL> contains picture locations of map legends. The <Format> element in LegendURL represents MIME types of legend pictures, and the width and height attributes of the <Format> element represent pixel sizes of pictures. Style can be inherited by child layers. If Name of the child layer is the same as that of the parent layer, then the child layer will not re-define Style. |
EX_GeographicBoundingBox |
Mandatory |
Geographic bounding boxes. Each named layer will contain a <EX_GeographicBoundingBox> element, indicating minimum bounding rectangle area covered by the layer, and represented by decimal degrees. EX_GeographicBoundingBox is helpful to geographic searches when having no coordinate conversions. This element consists of westBoundLongitude, eastBoundLongitude, southBoundLatitude and northBoundLatitude. EX_GeographicBoundingBox can inherit from the parent layer. We use EPSG:4326 at present. |
CRS |
Optional |
Coordinate reference system. Each layer has one or several CRS. CRS can be inherited by child layers. The root <Layer> element contains zero CRS element or several CRS elements, listing CRS general to all child layers. The value is CRS:1 after the planar coordinate system is published. |
BoundingBox |
Optional |
Bounding boxes. A layer contains one bounding box or several bounding boxes. The < BoundingBox> element contains following attributes:
BoundingBox metadata specifies coordinate extents of layers, and the request parameter BBOX specifies map areas. The BBOX area does not necessarily intersect with, or contain, or be contained by the BoundingBox area. BoundingBox can inherit from service layers. |
MinScaleDenominator & MaxScaleDenominator |
Mandatory |
Minimum and maximum scale denominators. Used to represent scale extents. If both elements do not exist, there are no scale constraints. |
Dimension |
Mandatory |
Applies to multi-dimensional data. Dimension inherits from the parent layer. |
MetadataURL |
Mandatory |
URL of metadata. A server should use one or several <MetadataURL> to provide layer data with detailed and standard metadata. Cannot be inherited by child layers. |
Attribution |
Mandatory |
This element is used to define geographic information sources of layers or layer collections.
This element can be inherited by child layers. |
Identifier & AuthorityURL |
Mandatory |
The WMS server can use zero or several <Identifier> to list ID numbers or labels defined by Authority. |
FeatureListURL |
Mandatory |
URL lists of features. |
DataURL |
Mandatory |
DataURL provides a hyperlink of data described by a specific layer. DataURL cannot be inherited by child layers. |
Table 3 Layer element attributes
Attribute | Permitted value | Description(the default is 0) |
queryable | 0, false, 1, true |
0, false: the layer is not queryable. 1, true: the layer is queryable. |
cascaded | 0, positive integer |
0: the layer has not been transmitted by cascading Map server. n: the layer has been transmitted for n times. |
opaque | 0, false, 1, true |
0, false: map data are not completely opaque. 1, true: map data are completely opaque. |
noSubsets | 0, false, 1, true |
0, false: WMS can draw subsets of a complete bounding box. 1, true: WMS only draws a complete bounding box. |
fixedWidth | 0, positive integer |
0: WMS can generate a map of an arbitrary width. none 0: width of the map is fixed, and WMS cannot modify it. |
fixedHeight | 0, positive integer |
0: WMS can generate a map of an arbitrary height. none 0: height of the map is fixed, and WMS cannot modify it. |
The response of the Request example is as follows: