Documentation Center

  • Trial Software
  • Product Updates


Class: WMSLayer

Refine search




layers.refine(querystr,Name,Value,...) searches for elements of layers in which values of the Layer or LayerName properties match the string querystr. Use the 'MatchType' property to control whether the method uses partial or exact matching. The default is partial matching.

Input Arguments


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

You can abbreviate parameter names and case does not matter.


Case-insensitive string or cell array of strings. Valid strings are 'abstract', 'layer', 'layertitle', 'layername', 'server', 'serverurl', 'servertitle', or 'any'.

Default: {'layer'}


Case-insensitive string with value 'partial' or 'exact'. If you specify 'MatchType' as 'partial', then a match is determined if the query string is found in the property value. If you specify 'MatchType' as 'exact', then a match is determined only if the query string exactly matches the property value. If you specify 'MatchType' as 'exact' and querystr as '*', a match is found if the property value matches the character '*'.

Default: 'partial'


Logical. If you set 'IgnoreCase' to true, then WMSLayer.refine ignores case when performing string comparisons.

Default: true


  • The WMSLayer.refine method searches the entries in the 'SearchFields' properties of layers for a partial match of the entry with querystr. The WMSLayer.refine method returns layer information if any supplied 'SearchFields' match. If you specify 'layer', then the method searches both the 'LayerTitle' and 'LayerName' properties. If you specify 'server', then the method searches both the 'ServerURL' and 'ServerTitle' fields. If you specify 'any', then the method searches the properties 'Abstract', 'LayerTitle', 'LayerName', 'ServerURL', and 'ServerTitle'.


Refine a search of temperature layers to find two different sets of layers: (1) layers containing only annual sea surface temperatures, and (2) layers containing annual temperatures or sea surface temperatures.

temperature = wmsfind('temperature');
annual = temperature.refine('annual');
sst = temperature.refine('sea surface');
annual_and_sst = sst.refine('annual');
annual_or_sst = [sst;annual];

See Also

Was this topic helpful?