Products & Services Solutions Academia Support User Community Company

Learn more about Mapping Toolbox   

wmsinfo - Information about WMS server from capabilities document

Syntax

[capabilities, infoRequestURL] = wmsinfo(serverURL)
[capabilities, infoRequestURL] = wmsinfo(infoRequestURL)
[capabilities, infoRequestURL] = wmsinfo(..., param, val)

Description

[capabilities, infoRequestURL] = wmsinfo(serverURL) accesses the Internet to read a capabilities document from a Web Map Service (WMS) server. (The capabilities document, an XML document, 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.

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

[capabilities, infoRequestURL] = wmsinfo(..., param, val) specifies a parameter-value pair that modifies the request to the server. The parameter name can be abbreviated and is case-insensitive. The 'TimeoutInSeconds' parameter, an integer-valued, scalar double, indicates the number of seconds to elapse before a server times out. The default value for this parameter is 60 seconds, and a value of 0 causes the time-out mechanism to be ignored.

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.

Note about Internet Connection

The wmsinfo function requires an Internet connection. Several minutes may elapse before the document is returned, or a WMS server may be unavailable. 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.

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.
gsfcLayers = wmsfind('gsfc.nasa.gov', 'SearchField', 'serverurl');
capabilities = wmsinfo(gsfcLayers(1).ServerURL);
% Display the layer information in the command window.
capabilities.Layer

Sample Output

           Index: 304
     ServerTitle: 'NASA SVS Image Server'
       ServerURL: 'http://aes.gsfc.nasa.gov/cgi-bin/wms?'
      LayerTitle: '(2048x2048 Animation)'
       LayerName: '3352_24736'
          Latlim: [38.3727 39.3133]
          Lonlim: [-91.1052 -89.9017]
        Abstract: 'During the first half of 1993, ....'
CoordRefSysCodes: {'EPSG:4326'}
         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

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

See Also

WebMapServer | WMSCapabilities | wmsfind | WMSLayer | wmsread

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS