Web Map Service (WMS) Overview

A request for map data from an OGC WMS server involves three main requests: GetCapabilities, GetMap, and GetFeatureInfo. The following describes these operations in terms of the IDLnetOGCWMS object:

For details on how to use the IDLnetOGCWMS object properties and methods to request and receive information from an OGC server, see Making OGC WMS Server Requests. Also see Sample WMS Browser for information about the IDL OGC WMS Browser, a sample program included in the IDL distribution.

Additional OGC Web Map Service Resources

The Open Geospatial Consortium web site provides complete details on the Web Map Service protocol including the WMS specification and schema documents. You may find the following documents helpful if you need additional WMS resources. See OGC web site (www.opengeospatial.org) to search for these and other resource files.

Table 33-16: OGC WMS Reference Documents 

Document
Description

Specification

OGC Web Map Service, Version 1.1.1,
Ref# OGC 01-068r3, 2002-01-16

OGC Web Map Service, Version 1.3.0,
Ref # OGC 04-024, 2004-08-02

Supported OGC WMS Version

This object supports version 1.1.1 and 1.3.0 of the OGC WMS standard. The IDLnetOGCWMS object conforms to the OGC WMS standard and is designed to communicate with OGC WMS compliant servers.

Note
Since this object is designed as an OGC WMS client, OGC WMS certification is not applicable. Compliance testing and certification is valid only for WMS servers.

Making OGC WMS Server Requests

This section outlines the steps required to query and return information from an OGC server. The goal is to return one or more layers as a rendered image map file. Broadly, an information request from a WMS sever requires determining what data is available from a server (layers), determining what data you want to request (the layer definition), making the request, and returning rendered map data. You then have the option to request specific information about a map feature if desired and if supported by the server.

Note
You can implement a callback to return information about the status of requests. See Using Callbacks with the IDLnetOGCWMS Object for details.

After you create an IDLnetOGCWMS object, you will need to complete the following steps:

  1. Identify the WMS server. The easiest way to do this is to pass a working URL to the IDLnetOGCWMS::ParseUrl method, which sets the required URL_HOSTNAME and URL_PATH properties. Alternately, manually set properties related to the URL. See Translating a URL into Property Values for information on which URL components belong to which IDLnetOGCWMS properties.
  2. Note
    If dealing with secure WMS servers, see HTTP Authentication, Security and Encoding for additional information.

  3. Determine what information is available on the WMS server by making a GetCapabilities request. This typically returns and parses an XML file that contains information about the available layers. See IDLnetOGCWMS::GetCapabilities for details. You can modify the CAPABILITIES_FILENAME property to specify where the resulting file is stored.
  4. Return the information contained in the layers by calling IDLnetOGCWMS::GetLayers. You must call this method to return information for the specified layer(s) in an IDL structure. The NAME field value of this structure is required to request additional information from an OGC server using the GetMap method, described next. If you wish, you can also call IDLnetOGCWMS::GetServiceSection to return service information from the XML file, but this is not necessary.
  5. Use IDLnetOGCWMS::GetMap to request the combination of one or more layers into a map, specifying the desired layers via the Map_Request argument. You can modify the MAP_FILENAME property to specify where the resulting file is stored.
  6. Access the information about features in the map by calling IDLnetOGCWMS::GetFeatureInfo. (The OGC WMS server may not offer this support for every layer, and there may not be information available for every feature). You can modify the FEATURE_INFO_FILENAME property to specify where the resulting file is stored.

Translating a URL into Property Values

A valid WMS server URL is required to establish communication with an OGC WMS server. Additionally, IDLnetOGCWMS URL-related property values must be set before data can be successfully requested from a OGC WMS server. Either set the required properties manually (using SetProperty) or pass a URL to ParseURL. The IDLnetOGCWMS::ParseUrl method automatically parses a given URL and sets related property values.

Note
Regardless of how properties are set, the URL_HOSTNAME and URL_PATH properties must be set before calling the GetCapabilities, GetMap or GetFeatureInfo methods.

The following table describes how the components of a given URL should be assigned to property values. Consider the following URL (which would typically exist on a single line):

http://my.hostname.com:8080/demo/cgi_path?CustomPrefix& 
Version=1.1.1&SERVICE=WMS&CustomMiddle&Request=GetCapabilities& 
CustomSuffix 

Components of this URL map to properties as follows.

Table 33-17: Mapping URL Components to Properties 

Property
Value

URL_SCHEME

http 

URL_HOSTNAME

my.hostname.com 

URL_PORT

8080 

URL_PATH

demo/cgi_path 

WMS_VERSION

Version=1.1.1 (or 1.3.0 but defaults to 1.1.1)

URL_QUERY_PREFIX

CustomPrefix&CustomMiddle 

URL_QUERY_SUFFIX

CustomSuffix 

The query portion of the URL passed to a WMS server (the parameter=value pairs following the ? character) always includes the following three parameters:

These three parameters are inserted into the URL automatically by IDL; any values specified for these parameters in the URL are ignored. They are not included when the URL_QUERY_PREFIX or URL_QUERY_SUFFIX properties are returned by the GetProperty method. Any query parameters that precede any of the three required parameters will be included in the URL_QUERY_PREFIX property by the ParseURL method; other nonrequired parameters will be included in the URL_QUERY_SUFFIX property.

Note
If not specified in the URL, property values besides URL_HOSTNAME and URL_PATH are set to default values. For example, the URL_PORT property defaults to 80 and the WMS_VERSION defaults to 1.1.1.