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.


Class: WMSLayer

Return URLs of unique servers


serverURLs = servers(layers)


serverURLs = servers(layers) returns a cell array of URLs of unique servers. layers is a Web Map Service Layers (WMSLayer) object.


expand all

Find the URLs for government servers.

layers = wmsfind('*.gov*','SearchField', 'serverurl');
serverURLs = servers(layers);
sprintf('%s\n', serverURLs{:})  
ans =

Find server URLs that contain temperature layers and return them in a Web Map Service Layers (WMSLayer) object.

temperature = wmsfind('temperature');
serverURLs = servers(temperature);
for k=1:numel(serverURLs)
   querystr = serverURLs{k};
   layers = refine(temperature,querystr, ...
      'SearchFields', 'serverurl');
   fprintf('Server URL\n%s\n', layers(1).ServerURL);
   fprintf('Number of layers: %d\n\n', numel(layers));
Server URL
Number of layers: 2

Server URL
Number of layers: 2

Server URL
Number of layers: 2
Was this topic helpful?