Main Content

refineLimits

Refine search of WMS layers based on geographic limits

Description

refined = refineLimits(layers,Name,Value,...) searches for elements of Web map service layers, layers, that match specific latitude or longitude limits. The results include a given layer only if the quadrangle specified by the optional 'Latlim' and 'Lonlim' parameters fully contains the boundary quadrangle, as defined by the Latlim and Lonlim properties. Partial overlap does not result in a match. All angles are in units of degrees.

example

Examples

collapse all

Find layers in the WMS Database that contain information about hurricanes.

layers = wmsfind('hurricane');
num_layers = length(layers)
num_layers = 
77

Refine the search by finding layers that are in the western hemisphere.

refined = refineLimits(layers, ...
    'Latlim',[-90 90],'Lonlim',[-180 0]);
num_refined = length(refined)
num_refined = 
32

Note that the refined array contains fewer layers.

Your results might be different because the WMS Database changes each release.

Search the WMS Database for layers containing elevation data.

elevation = wmsfind('elevation');

Refine the search by specifying latitude and longitude limits.

latlim = [-90, 90];
lonlim = [-180, 180];
globalElevation = ...
    refineLimits(elevation,'Latlim',latlim,'Lonlim',lonlim);

Display the server titles as a column vector. Your results might be different because the WMS Database changes each release.

serverTitles(globalElevation)'
ans = 5x1 cell
    {'CubeSERV WMS'                                }
    {'NASA Earth Observations (NEO) WMS'           }
    {'Web Map Service for data hosted by MathWorks'}
    {'World Map'                                   }
    {'World Map'                                   }

Input Arguments

collapse all

Layers to search, specified as an array of WMSLayer objects.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'Latlim',[0 90]

Latitudinal limits to search, specified as a two-element vector. Latlim is in the form [southern_limit northern_limit] or a scalar value representing the latitude of a single point.

Example: [-90, 90]

Longitudinal limits to search, specified as a numeric scalar or two-element numeric vector. Lonlim is in the form [western_limit eastern_limit] or a scalar value representing the longitude of a single point.

Example: [-180, 180]

Output Arguments

collapse all

Refined layers, specified as an array of WMSLayer objects. Each layer in the array has a boundary quadrangle that is fully contained in the quadrangle defined by the specified 'Latlim' and 'Lonlim' parameters.

Tips

  • The default value of [] for either 'Latlim' or 'Lonlim' implies that all layers match the criteria. For example, if you specify the following, then the results include all the layers that cover the northern hemisphere.

    refineLimits(layer,'Latlim', [0 90], 'Lonlim', [])

Version History

Introduced in R2009b

See Also

|