| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Mapping Toolbox |
| Contents | Index |
| Learn more about Mapping Toolbox |
Web Map Service layer object
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.
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.
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 |
| disp | Display properties |
| refine | Refine search |
| refineLimits | Refine search based on geographic limits |
| servers | Return URLs of unique servers |
| serverTitles | Return titles of unique servers |
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)

WebMapServer | WMSCapabilities | wmsfind | wmsinfo | WMSMapRequest | wmsread | wmsupdate
![]() | wmsinfo | disp (WMSLayer) | ![]() |

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 |