wmsinfo

Information about WMS server from capabilities document

Syntax

[capabilities, infoRequestURL] = wmsinfo(serverURL)
[capabilities, infoRequestURL] = wmsinfo(infoRequestURL)
[capabilities, infoRequestURL] = wmsinfo(___,Name,Value)

Description

[capabilities, infoRequestURL] = wmsinfo(serverURL) accesses the Internet to read a capabilities document from a Web Map Service (WMS) server. A capabilities document is an XML document that contains metadata describing the geographic content offered by the server. The wmsinfo function returns the contents of the capabilities document into capabilities, a WMSCapabilities object. The WMS server URL serverURL contains the protocol 'http://' or 'https://' and additional WMS or access keywords. You can insert the URL string infoRequestURL, composed of the serverURL with additional WMS parameters, into a browser or urlread to return the XML capabilities document. The wmsinfo function requires an Internet connection. Periodically, the WMS server is unavailable. Retrieving the map can take several minutes.

[capabilities, infoRequestURL] = wmsinfo(infoRequestURL) reads the capabilities document from a WMS infoRequestURL and returns the contents into capabilities.

[capabilities, infoRequestURL] = wmsinfo(___,Name,Value) specifies a parameter-value pair that modifies the request to the server.

Input Arguments

serverURL

WMS server URL that contains the protocol 'http://' or 'https://' and additional WMS or access keywords.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

You can abbreviate the parameter name, which is case-insensitive.

'TimeoutInSeconds'

Integer-valued, scalar double that indicates the number of seconds to elapse before a server times out. A value of 0 causes the time-out mechanism to be ignored.

Default: 60 seconds

Output Arguments

capabilities

WMSCapabilities object.

infoRequestURL

URL string composed of the serverURL with additional WMS parameters.

Examples

Use wmsinfo to read a capabilities document and display the abstract of the first layer.

% Read the capabilities document from the NASA Goddard
% Space Flight Center WMS server.
serverURL = 'http://svs.gsfc.nasa.gov/cgi-bin/wms?'; 
capabilities = wmsinfo(serverURL);
% Display the layer information in the command window.
capabilities.Layer

Sample output follows:

        Index: 304 
     ServerTitle: 'NASA SVS Image Server' 
       ServerURL: 'http://svs.gsfc.nasa.gov/cgi-bin/wms?' 
      LayerTitle: '(4096x2048 Animation)' 
       LayerName: '3348_27724' 
          Latlim: [-90.0000 90.0000] 
          Lonlim: [-180.0000 180.0000] 
        Abstract: 'NASA's Aqua satellite was launched ... 
CoordRefSysCodes: {'CRS:84'} 
         Details: [1x1 struct] 
   
% Refine the list to include only layers with the term 
% "glacier retreat" in the LayerTitle.
glaciers = capabilities.Layer.refine('glacier retreat', ...
   'SearchFields', 'LayerTitle');
% Display the abstract of the first layer.
glaciers(1).Abstract

Sample output follows:

Since measurements of Jakobshavn Isbrae were first taken....

More About

expand all

Tips

  • To specify a proxy server to connect to the Internet, select File>Preferences>Web and enter your proxy information. Use this feature if you have a firewall.

  • wmsinfo communicates with the server using a WebMapServer handle object representing an implementation of a WMS specification. The handle object acts as a proxy to a WMS server and resides physically on the client side. The handle object accesses the server's capabilities document. The handle object supports multiple WMS versions and negotiates with the server to use the highest known version that the server can support. The handle object automatically times-out after 60 seconds if a connection is not made to the server.

Was this topic helpful?