Main Content

limitm

(Removed) Determine latitude and longitude limits of regular data grid

limitm has been removed. Instead, create a geographic raster reference object, and query its LatitudeLimits and LongitudeLimits properties. For more information, see Version History.

Syntax

[latlim,lonlim] = limitm(Z,R)
latlonlim = limitm(Z,R)

Description

[latlim,lonlim] = limitm(Z,R) computes the latitude and longitude limits of the geographic quadrangle bounding the regular data grid Z spatially referenced by R. R can be a geographic raster reference object, a referencing vector, or a referencing matrix.

If R is a geographic raster reference object, its RasterSize property must be consistent with size(Z).

If R is a referencing vector, it must be 1-by-3 with elements:

[cells/degree northern_latitude_limit western_longitude_limit]
If R is a referencing matrix, it must be 3-by-2 and transform raster row and column indices to/from geographic coordinates according to:
[lon lat] = [row col 1] * R
If R is a referencing matrix, it must also define a (non-rotational, non-skewed) relationship in which each column of the data grid falls along a meridian and each row falls along a parallel. The output latlim is a vector of the form [southern_limit northern_limit] and lonlim is a vector of the form [western_limit eastern_limit]. All angles are in units of degrees.

latlonlim = limitm(Z,R) concatenates latlim and lonlim into a 1-by-4 row vector of the form:

[southern_limit northern_limit western_limit eastern_limit]

Examples

Load elevation raster data and a geographic cells reference object. Then, find the latitude and longitude limits.

load topo60c
[latlimits,lonlimits] = limitm(topo60c,topo60cR)
latlimits =

   -90    90


lonlimits =

     0   360

The data set covers the whole globe, so the result is expected.

Version History

Introduced before R2006a

expand all

R2023b: Removed

Some functions that accept referencing vectors or referencing matrices as input have been removed, including the limitm function. Instead, create a geographic raster reference object, and query its LatitudeLimits and LongitudeLimits properties. Reference objects have several advantages over referencing vectors and matrices.

  • Unlike referencing vectors and matrices, reference objects have properties that document the size of the associated raster, its geographic limits, and the direction of its rows and columns. For more information about reference object properties, see the GeographicCellsReference and GeographicPostingsReference objects.

  • You can manipulate the limits of rasters associated with reference objects using the geocrop function.

  • You can manipulate the size and resolution of rasters associated with reference objects using the georesize function.

To update your code, first create a reference object for either a raster of cells using the georefcells function or a raster of regularly posted samples using the georefpostings function. Alternatively, convert from a referencing vector or a referencing matrix to a reference object using the refvecToGeoRasterReference or refmatToGeoRasterReference function, respectively.

Then, find the limits of the raster by querying the LatitudeLimits and LongitudeLimits properties of the reference object, R.

latlim = R.LatitudeLimits;
lonlim = R.LongitudeLimits;