This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Information about WMS server from capabilities document


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



[capabilities,infoRequestURL] = wmsinfo(serverURL) accesses the Internet to read a capabilities document from a Web Map Service (WMS) server specified by string or character vector serverURL. 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 in capabilities, a WMSCapabilities object. The wmsinfo function also returns the character vector infoRequestURL, which is composed of the serverURL with additional WMS parameters. You can insert infoRequestURL into a browser, or the urlread function, to get the XML capabilities document.

The wmsinfo function requires an Internet connection. WMS servers can periodically be unavailable. Retrieving the map can take several minutes.

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

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


collapse all

Read the capabilities document from the NASA Goddard Space Flight Center WMS server.

serverURL = ''; 
capabilities = wmsinfo(serverURL);

Display the layer information in the command window.

 Index: 304 
     ServerTitle: 'NASA SVS Image Server' 
       ServerURL: '' 
      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.

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

Input Arguments

collapse all

WMS server URL, specified as a string scalar or character vector. The serverURL contains the protocol 'http://' or 'https://' and additional WMS or access keywords.

Data Types: char | string

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 quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: capabilities = wmsinfo(serverURL,'TimeoutInSeconds',5);

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

Number of seconds to elapse before a server times out, specified as an integer-valued, scalar double. If you specify the value 0, wmsinfo ignores the time-out mechanism.

Data Types: double | int16 | int32 | int64 | int8 | single | uint8 | uint16 | uint32 | uint64

Output Arguments

collapse all

Capabilities document, returned as a WMSCapabilities object.

URL composed of the serverURL with additional WMS parameters, returned as a character vector.


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

Introduced in R2009b