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.


Synchronize WMSLayer object with server


[updatedLayers,index] = wmsupdate(layers)
[...] = wmsupdate(layers,Name,Value, ...)


[updatedLayers,index] = wmsupdate(layers) returns a Web Map Service (WMS) layer array with its properties synchronized with values from the server, where layers contains only one, unique ServerURL. wmsupdate removes layers that are no longer available on the server.

wmsupdate returns the logical array index which contains true for each available layer. Thus, the return value updatedLayers has the same size as layers(index). Except for deletion, updatedLayers preserves the same order of layers as layers.

[...] = wmsupdate(layers,Name,Value, ...) specifies parameter-value pairs that modify the request. Parameter names can be abbreviated and are case-insensitive.

The function accesses the Internet to update the properties. Periodically, the WMS server is unavailable. Updating the layer can take several minutes. The function times-out after 60 seconds if a connection is not made to the server.


collapse all


nasa = wmsfind('', 'SearchField', 'serverurl');
nasa = wmsupdate(nasa, 'AllowMultipleServers', true);

Search the abstract field of the updated layers to find layers containing the term 'blue marble'. Read and display the first blue marble layer containing the term '512' and 'image' in its LayerTitle.

gsfc = wmsfind('', 'SearchField', 'serverurl');
gsfc = wmsupdate(gsfc);
blue_marble = refine(gsfc,'blue marble', 'SearchField', 'abstract');
queryStr = '*512*image';
layers =  refine(blue_marble,queryStr);
layer = layers(1);

Display the layer and abstract.

[A, R] = wmsread(layer);
worldmap world
plabel off
mlabel off

Input Arguments

collapse all

Updated layers, specified as an array of WMSLayer objects.

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.

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

Layer array may contain elements from multiple servers, specified as true or false. The value false indicates the array must contain elements from the same server. Use caution when setting the value to true, since you are making a request to each unique server and each request can take several minutes to finish.

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

Output Arguments

collapse all

Synchronized layers, returned as an array of WMSLayer objects with its properties synchronized with values from the server.

Available layers, returned as a logical array where the value true indicates that the layer was available from the server.


  • To specify a proxy server to connect to the Internet, click Preferences and, in the Preferences dialog box, select Web. Enter your proxy information. Use this feature if you have a firewall.

Introduced in R2009b