GetCapabilities Response |
In the specific case of a WMS conforming to the OGC standard, a DTD (XML Document Type Definition), the XML response must be legitimate. The DTD indicates the required and optional content in the response, as well as the formatting of the content.
The Capabilities XML document for the server completely references the DTD document, not the body of the URL. The DTD file must be located in a fully qualified and usable URL to allow XML validation software to retrieve it.
WMS Capabilities XML mainly includes Service and Capability .
The content in the <Service> element in the WMS Capabilities XML represents the General service metadata, which provides an overall description of the server's common metadata. This data includes Name, Title, and Online Resource URL element, plus some optional content: Abstract, KeywordList, ContactInformation, Fees, and AccessConstraints Elements, etc.
Table 1 Elements of Common Service Metadata
Element name | Description |
Name | The name of the WMS service. |
Title |
Service title A short description of the server, depending on the service providers, to distinguish it from other servers. |
Abstract |
Summary of services Provides a more descriptive description of the server information. |
KeywordList |
Keyword. The server as a whole can help with directory searches. |
OnlineResource |
Online resource Provides a website reference for service providers. The other Online Resource elements are URL prefixes for each action. |
ContactInformation |
Contact information, including provider name, address, telephone, fax, email, etc. This element should be included in the service metadata. |
Fees |
Cost. If the server does not apply a charge, this element can be ignored. If this element is used, "none" (case insensitive) means free, as in “<Fees>none</Fees>”. |
AccessConstraints |
Access restrictions. If no access restrictions are applied by the server, this element can be ignored. If this element is used, "none" (case insensitive) indicates no access restrictions, as in “<AccessConstraints>none</AccessConstraints>”. If this element is used, the content of the element does not have a precise syntax definition, and the client can display user information and behavior content. |
The content in the <Capability> element expresses the requests (GetCapabilities, GetMap or GetFeatureInfo) supported by the server instance, the output format provided by each operation, and the URL prefix for each operation. The XML DTD includes the Distributed Platform Placeholders and other HTTP request methods. But currently only HTTP GET is defined as the basic WMS operation.
Ignored service providers-specific elements can be included in a <Capability > element. The WMS will also contain The <User DefinedS ymbolization> element and the URL of the HTTP POST request.
Layer and Style are the most important parts of a WMS Capabilities XML document.
Each available map is listed in the Capabilities XML document through the <Layer> element. A parent layer can contain any number of child layers.
The map provider must include at least one <Layer> element in each provided map.
The <Style> node provides a Styled list of layers, STYLES via SLD (Styled-Layer Descriptor). The STYLES listed in the Capabilities XML document are predefined by the server.
Currently, the Name, Title, and Keywords of Layer/Style are optional.
The nested child elements of the <Layer> element express the attribute information of the layer.
Table 2 Layer Properties
Element | Whether it is required |
Description |
Title |
Yes |
Layer title. Each layer must have a title. Cannot be inherited by child layers. |
Name |
No |
Tileset name If the layer has <Name> element, you can use Name as the value of the LAYERS parameter in the Get Map request. The client will not request a layer with a Title and no Name. If the client requests an illegal layer, the WMS server will throw a service exception (code="LayerNotDefined"). Name cannot be inherited by child layers. |
Abstract |
No |
Layer summary. Provides a more detailed description of the layer. Abstract cannot be inherited from a quilt layer. |
KeywordList |
No |
Keyword list. KeywordList contains 0 or more <Keyword> element helps with directory searches. KeywordList cannot be inherited from layers. |
Style |
No |
Layer style. 0 or more <Style> is used to represent the style of a single layer or collection of layers. Each Style contains a <Name> and <Title> element. Name Used to set the STYLES parameter in the GetMap request. Style may also contain other elements. <Abstract> provideds a description of the style, <LegendURL> contains the picture location of the map legend. The <Format> element in LegendURL indicates the MIME type of the legend image. The width and height properties of the <Format> element represent the pixel size of the image. Style can be inherited by a child layer, and if the name of the child layer is the same as the parent layer, the child layer will not redefine the Style. |
SRS |
Yes |
Spatical Reference System. Each layer has one or more SRSs. SRS can be inherited by sub-layers. Root element <Layer> contains zero or more SRS elements that are common to all sublayer SRS. The support for spatial reference systems can be found in the coordinate reference system supported by iServer OGC service. |
LatLonBoundingBox |
No |
Latitude and longitude bounding box. Each layer must contain at least one < LatLonBoundingBox> Elements can be declared or inherited from a parent layer. The LatLonBoundingBox declares the smallest bounding rectangle of the map data in the EPSG: 4326 coordinate system. Its attributes minx, miny, Maxx, maxy represents the boundaries of a rectangle in decimal degrees. The LatLonBoundingBox facilitates geographic search when coordinate conversion is not required. |
BoundingBox |
Yes |
Bounding box. A layer contains 1 or more bounding boxes. < BoundingBox> The element contains the following attributes:
The BoundingBox metadata indicates the coordinate range of the layer, and the request parameter BBOX indicates the area of the map. BBOX Regions and BoundingBox regions do not have to intersect, contain, or be contained. BoundingBox can inherit from the parent layer. |
ScaleHint |
No |
< ScaleHint> The element gives the minimum and maximum scale at which the layer can be properly displayed. ScaleHint has two values: minimum and maximum ScaleHint can be sublayer-inherited. ScaleHint defined in a child layer overrides the definition inherited from the parent layer. |
Dimension |
No |
Used for multidimensional data. Dimension definitions can be inherited from the parent layer. Any new Dimension definition in a child layer can be added to the list of inherited parent layers. Child layers cannot redefine objects with the same name that inherit from the parent layer Dimension element. |
Extent |
No |
Used for multidimensional data. The definition of an Extent can be inherited from the parent layer. The declaration of an Extent of the same name in a child layer that inherits from the parent layer overrides the value declared in the parent layer. Only when An Extent is declared only if a Dimension of the same name has been declared or inherited from a Layer in a Capabilities XML document. |
MetadataURL |
No |
Metadata URL. A server should use 1 or more <MetadataURL> To provide layer data details and standard metadata. Two types are currently defined: 'TC211' Refer to [ISO 19115]; refer to [FGDC-STD-001-1988] for 'FGDC'. The Metadata URL element cannot be used as a reference in a non-standard metadata format, and the <Formmat> element contained within it indicates the file format of the MIME type of the metadata record. This element cannot be inherited from the quilt layer. |
Attribution |
No |
This element is used to define the source of geographic information for a layer or collection of layers. <OnlineResource> represents the URL of the data provider. <Title> is the name of the data provider. <LogoURL> is the URL of the Logo image. <Format> indicates the MIME type of the Logto picture. <width> and <height> Property specifies the pixel size of the image. This element can be inherited from the quilt layer. |
Identifier and AuthorityURL |
No |
The WMS server can use zero or more <Identifiers> to enumerate Authority-defined ID numbers or labels. |
FeatureListURL |
No |
List of feature URL Used to point to a list of features on a layer. FeatureListURL cannot be sublayer-inherited. |
DataURL |
No |
The DataURL provides a link to the data described by a particular layer. DataURL cannot be sublayer-inherited. |
CRS |
Yes |
Coordinate Reference System. Each layer has one or more CRSs. CRS can be inherited by sub-layers. Root <Layer> element contains zero or more CRS elements and enumerates the CRSs that are common to all sublayers. The support for spatial reference systems can be found in the coordinate reference system supported by iServer OGC service. |
The < Layer > element can have zero or more of the following XML attributes: queryable, cascaded, opaque, noSubsets, fixedWidth,fixedHeight. These attributes are optional. Each attribute can be inherited or overridden by a sub-layer.
Table 3 Layer Attributes
Attribute | Allowed values | Meaning (default is 0) |
queryable | 0, 1 |
0: Layer not searchable. 1: Layer can be checked. |
cascaded | 0, positive integer |
0: The layer has not been forwarded by the Cascade Map Server (Cascading Map Server). n: The layer has been forwarded n times. |
opaque | 0, 1 |
0: The map data is not completely opaque. 1: The map data is completely opaque. |
noSubsets | 0, 1 |
0: WMS can draw a subset of a full bounding box. 1: WMS draws only the full bounding box. |
fixedWidth | 0, positive integer |
0: WMS can generate a map of any width. Non-0: The width of the map is fixed and cannot be modified by WMS. |
fixedHeight | 0, positive integer |
0: WMS can generate a map of any height. Non-0: The height of the map is fixed and cannot be modified by WMS. |
The MIME type of the data returned by the GetCapabilities operation is application/vnd.ogc.wms_xml, which is essentially an XML document.
An example of the response content for the GetCapabilities Request sample is as follows: