Products & Services Solutions Academia Support User Community Company

Learn more about Mapping Toolbox   

WMSLayer class -

Web Map Service layer object

Description

A WMSLayer object describes a Web Map Service (WMS) layer or layers. Obtain a WMSLayer object by using wmsfind or wmsinfo. The function wmsfind returns a WMSLayer array. The function wmsinfo returns a WMSCapabilities object, which contains a WMSLayer array in its Layer property.

Construction

layers = WMSLayer(param, val, ...) constructs a WMSLayer object from the input parameter names and values. If a parameter name matches a property name of the WMSLayer class—ServerTitle, ServerURL, LayerTitle, LayerName, Latlim, Lonlim, Abstract, CoordRefSysCodes, or Details, then the values of the parameter are copied to the property. The size of the output layers is scalar unless all inputs are cell arrays, in which case, the size of layers matches the size of the cell arrays.

Properties

You cannot set properties of the class except for 'Latlim' and 'Lonlim', which have public set access.

ServerTitle

Descriptive information about the server

Data Type: string

Default: ''

ServerURL

The URL of the server

Data Type: string

Default: ''

LayerTitle

Descriptive information about the layer; clarifies the meaning of the raster values of the layer

Data Type: string

Default: ''

LayerName

The keyword the server uses to retrieve the layer

Data Type: string

Default: ''

Latlim

The southern and northern latitude limits of the layer in units of degrees

Data Type: two-element vector

Default: []

Lonlim

The western and eastern longitude limits of the layer in units of degrees

Data Type: two-element vector

Default: []

Abstract

Information about the layer

Data Type: string

Default: ''

CoordRefSysCodes

String codes of available coordinate reference systems

Data Type: cell array

Default: {}

Details

Detailed information about the layer: MetadataURL, Attributes, Scale, Dimension, Style. See the WMSLayer.Details reference page for more information.

Data Type: structure

Methods

dispDisplay properties
refineRefine search
refineLimitsRefine search based on geographic limits
serversReturn URLs of unique servers
serverTitlesReturn titles of unique servers

Example

Construct a WMSLayer object from a WMS GetMap request URL.

serverURL = 'http://onearth.jpl.nasa.gov/wms.cgi?';
url = [serverURL 'SERVICE=WMS' ...
   '&LAYERS=daily_planet&EXCEPTIONS=application/...
       vnd.ogc.se_xml', ...
   '&FORMAT=image/jpeg&TRANSPARENT=FALSE&HEIGHT=288', ...
   '&BGCOLOR=0xFFFFFF&REQUEST=GetMap&WIDTH=720&STYLES=' ...
   '&BBOX=-180.0,-72.0,180.0,72.0&SRS=EPSG:4326&VERSION=1.1.1'];
 
layer = WMSLayer('ServerURL', serverURL, ...
   'LayerName', 'daily_planet', ...
   'Latlim', [-72, 72], 'Lonlim', [-180,180]);
layer = wmsupdate(layer);
[A, R] = wmsread(layer, 'ImageHeight', 288, 'ImageWidth', 720);
figure
worldmap world
setm(gca,'maplatlimit',layer.Latlim, 'maplonlimit',layer.Lonlim)
mlabel off;plabel off
geoshow(A,R)

See Also

WebMapServer | WMSCapabilities | wmsfind | wmsinfo | WMSMapRequest | wmsread | wmsupdate

  


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