This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan 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. The input layers contains only one unique ServerURL. Layers no longer available on the server are removed. The logical array index contains true for each available layer. Therefore, 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.

Input Arguments


Array of WMSLayer objects

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 single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.


Integer-valued, scalar double that indicates the number of seconds before a server times out. A value of 0 causes the time-out mechanism to be ignored.

Default: 60 seconds


Logical scalar that indicates whether the layer array may contain elements from multiple servers. Use caution when setting the value to true, since you are making a request to each unique server. Each request can take several minutes to finish.

Default: false (indicates the array must contain elements from the same server)

Output Arguments


WMSLayer array with its properties synchronized with values from the server.


Logical array that contains true for each available layer.


Update the layers from the NASA Goddard Space Flight Center WMS SVS Image Server:

% 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

Update the properties of all the layers from NASA's Goddard Space Flight Center WMS servers:

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


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

See Also


Using Objects

Introduced in R2009b

Was this topic helpful?