Refine search of WMS layers based on geographic limits



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.


collapse all

Find layers containing global elevation data.

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

Print out the server titles from the unique servers.

ans = 

    'Ceoware2 WMS'
    'CubeSERV WMS'
    'CubeSERV Demo WMS'
    'deegree wms'
    'NASA Earth Observations (NEO) WMS'
    'JPL Planetary Map Service'
    'LMMP Tiled Web Map Service'
    'MicroImages TNTserver 7.3'
    'CubeSERV WMS'
    'ORNL DAAC WMS Server'
    'NASA WorldWind WMS'
    'World Map'
    'World Map'
    'CubeSERV WMS'

Input Arguments

collapse all

Layers to search, specified as an 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 quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

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.


  • 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', [])

See Also


Introduced in R2009b