Main Content

wmsinfo

Information about WMS server from capabilities document

Description

example

[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(___,'TimeoutInSeconds',sec) specifies the number of seconds before a server times out. Specify sec as a non-negative integer. If you specify sec as 0, then wmsinfo ignores the time-out mechanism.

Examples

collapse all

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 information about the first layer.

capabilities.Layer(1)
ans = 
  WMSLayer

  Properties:
           Index: 1
     ServerTitle: 'NASA SVS Image Server'
       ServerURL: 'http://svs.gsfc.nasa.gov/cgi-bin/wms?'
      LayerTitle: 'African Fires During 2002 (1024x1024 Animation)'
       LayerName: '2890_17402'
          Latlim: [-39.0000 41.0000]
          Lonlim: [-22.0000 58.0000]
        Abstract: 'This animation shows fire activity in Africa from January 1, 2002 to December 31, 2002. The fires are shown as tiny particles with each particle depicting the geographic region in which fire was detected. The color of a particle represents the number of days since a sizable amount of fire was detected in that region, with red representing less than 20 days, orange representing 20 to 40 days, yellow representing 40 to 60 days, and gray to black representing more than 60 days. This data was measured by the MODIS instrument on the Terra satellite. MODIS detects fires by measuring the brightness temperature of a region in several frequency bands and looking for hot spots where this temperature is greater than the surrounding region.

Additional Credit:
B>Please give credit for this item to:</b><br />'
CoordRefSysCodes: {'CRS:84'}
         Details: [1x1 struct]

  Methods

Refine the list to include only layers with the term "glacier retreat" in the layer title.

glaciers = capabilities.Layer.refine('glacier retreat', ...
    'SearchFields','LayerTitle');

Display the abstract of the first layer.

glaciers(1).Abstract
ans = 
    'Since measurements of Jakobshavn Isbrae were first taken in 1850, the glacier has gradually receded, finally coming to rest at a certain point for the past 5 decades. However, from 1997 to 2003, the glacier has begun to recede again, this time almost doubling in speed. The finding is important for many reasons. For starters, as more ice moves from glaciers on land into the ocean, it raises sea levels. Jakobshavn Isbrae is Greenland's largest outlet glacier, draining 6.5 percent of Greenland's ice sheet area. The ice stream's speed-up and near-doubling of ice flow from land into the ocean has increased the rate of sea level rise by about .06 millimeters (about .002 inches) per year, or roughly 4 percent of the 20th century rate of sea level increase.  This animation shows the recession for three years, from 2001 through 2003.  The line of recession shows the place where the glacier meets the ocean and where pieces calve off and flow away from land toward open water.
     
     Additional Credit:
     B>Please give credit for this item to:</b><br />'

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

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.

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 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