wmsfind

Search local database for Web map servers and layers

Syntax

layers = wmsfind(querystr)
layers = wmsfind(querystr, Name,Value, ...)

Description

layers = wmsfind(querystr) searches the LayerTitle and LayerName fields of the installed Web Map Service (WMS) Database for partial matches with the string querystr. WMS servers, by definition, produce maps of spatially referenced raster data. You can search for specific types of data, known as layers, such as temperature or elevation. The string querystr can contain the wildcard character '*'. The array returned by wmsfind, layers, contains one element for each layer whose name or title partially matches querystr. Each element is a WMSLayer object.

The installed WMS Database contains a subset of the WMSLayer properties (ServerTitle, ServerURL, LayerTitle, LayerName, Latlim, and Lonlim). The information found in the database is static and is not automatically updated; it was validated at the time of the software release.

layers = wmsfind(querystr, Name,Value, ...) modifies the search of the WMS database based on the values of the parameters. You can abbreviate parameter names, and case does not matter.

Input Arguments

querystr

Specifies the search string, such as 'temperature'

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.

'IgnoreCase'

Logical that specifies whether to ignore case when performing string comparisons. Possible values are true or false.

Default: true

'Latlim'

Two-element vector of latitude specifying the latitudinal limits of the search in the form [southern_limit northern_limit] or scalar value representing the latitude of a single point. All angles are in units of degrees.

If provided and not empty, a given layer appears in the results only if its limits fully contain the specified 'Latlim' limits. Partial overlap does not result in a match.

'Lonlim'

Two-element vector of longitude specifying the longitudinal limits of the search in the form [western_limit eastern_limit] or scalar value representing the longitude of a single point. All angles are in units of degrees.

If provided and not empty, a given layer appears in the results only if its limits contain the specified 'Lonlim' limits. Partial overlap does not result in a match.

'MatchType'

String with value 'partial' or 'exact'. For a partial string match, specify 'partial' for the 'MatchType'. For an exact match, specify 'exact'. If 'MatchType' is 'exact' and querystr is '*', a match occurs when the search field matches the character '*'.

Default: 'partial'

'SearchFields'

String or cell array of strings. Valid strings are 'layer', 'layertitle', 'layername', 'server', 'serverurl', 'servertitle', or 'any'.

The function searches the entries in the 'SearchFields' of the WMS database for a partial match with querystr. If you specify 'layer', then wmsfind searches both the 'layertitle' and 'layername' fields. If you specify 'server', then wmsfind searches both the 'serverurl' and 'servertitle' fields. The function returns layer information if any supplied 'SearchFields' match.

Default: {'layer'}

Output Arguments

layers

Array that contains one element for each layer whose name or title partially matches querystr. Each element is a WMSLayer object.

Examples

Find all layers that contain temperature data and return a WMSLayer array:

layers = wmsfind('temperature');

Find all layers that contain global temperature data and return a WMSLayer array:

layers = wmsfind('global*temperature');

Find all layers that contain an exact match for 'Rivers' in the LayerTitle field and return a WMSLayer array:

layers = wmsfind('Major Rivers', 'MatchType', 'exact', ...
   'IgnoreCase', false, 'SearchFields', 'layertitle');

Find all layers that contain a partial match for 'elevation' in the LayerName field and return a WMSLayer array:

layers = wmsfind('elevation', 'SearchField', 'layername');

Find all unique servers that contain 'BlueMarbleNG' as a layer name:

layers = wmsfind('BlueMarbleNG', ...
   'SearchField', 'layername', 'MatchType', 'exact');
servers = layers.servers;

Find layers that contain elevation data for Colorado and return a WMSLayer array:

latlim = [35,43];
lonlim = [-111,-101];
layers = wmsfind('elevation', ...
   'Latlim', latlim, 'Lonlim', lonlim);

Find all layers that contain temperature data for a point in Perth, Australia, and return a WMSLayer array:

lat = -31.9452;
lon = 115.8323;
layers = wmsfind('temperature', 'Latlim', lat, 'Lonlim', lon);

Find all the layers provided by servers located at the Jet Propulsion Laboratory (JPL). Display to the command window each server URL, layer title, and layer name:

layers = wmsfind('jpl.nasa.gov', 'SearchField', 'serverurl');
layers.disp('Properties', {'serverURL', 'layerTitle','layerName'});

Find all unique URLs of government servers:

layers = wmsfind('*.gov*', 'SearchField', 'serverurl');
servers = layers.servers;

Perform multiple searches. Find all layers that contain temperature in the layer name or title fields:

temperature = wmsfind('temperature', ...
   'SearchField',{'layertitle', 'layername'});

Find sea surface temperature layers:

sst = temperature.refine('sea surface');

Find and display to the command window a list of global sea surface temperature layers:

global_sst = sst.refine('global')

Perform multiple listings and searches of the entire WMS database. Please note that finding all the layers from the WMS database may take several seconds to execute and require a substantial amount of memory.

layers = wmsfind('*');

Sort and display to the command window the unique layer titles in the WMS database:

layerTitles = sort(unique({layers.LayerTitle}))'

Refine layers to include only layers with global coverage:

global_layers = layers.refineLimits('Latlim', [-90 90], ...
   'Lonlim', [-180 180]);

Refine global_layers to contain only topography layers that have global extent:

topography = global_layers.refine('topography');

Refine layers to contain only layers that have the terms "oil" and "gas" in the LayerTitle:

oil_gas = layers.refine('oil*gas', 'SearchField', 'layertitle');

More About

expand all

Tips

  • The WMS Database does not store content for the properties 'Abstract', 'CoordRefSysCodes', and 'Details'. Therefore, you cannot use wmsfind to search these properties. Populate these fields by using the wmsupdate function. This function updates these properties by downloading information from the server. The WMSLayer.disp method does not automatically display these unpopulated properties. Set the WMSLayer.disp 'Properties' parameter to 'all' to view. After you have viewed the information available from wmsupdate, if you still want to know more about the WMS server, use the function wmsinfo with the specific server URL.

See Also

| |

Was this topic helpful?