Raster geodata consists of georeferenced data grids and images that in the MATLAB® workspace are stored as matrices or objects. While raster geodata looks like any other matrix of real numbers, what sets it apart is that it is georeferenced, either to the globe or to a specified map projection, so that each pixel of data occupies a known patch of territory on the planet.
Whether a raster geodata set covers the entire planet or not, its placement and resolution must be specified. This additional information can be supplied in the form of a referencing object, a referencing matrix, or a referencing vector.
A referencing object is an instance of the
for raster data referenced to a geographic latitude-longitude system,
map.rasterref.MapRasterReference class, for raster data referenced to a planar
(projected) map coordinate system. A spatial referencing object encapsulates
the relationship between a geographic or planar coordinate system
and a system of intrinsic coordinates anchored to the columns and
rows of a 2-D spatially referenced raster grid or image. Unlike the
older referencing matrix and vector representations (described below),
a referencing object is self-documenting, providing a rich set of
properties to describe both the intrinsic and extrinsic geometry.
The use of referencing objects is preferred, but referencing matrices
and vectors continue to be supported for the purpose of compatibility.
A referencing matrix is a 3-by-2 matrix of doubles that describes
the scaling, orientation, and placement of the data grid on the globe.
For a given referencing matrix,
R, one of the following
relations holds between rows and columns and coordinates (depending
on whether the grid is based on map coordinates or geographic coordinates,
[x y] = [row col 1] * R, or [long lat] = [row col 1] * R
For additional details about and examples of using referencing
matrices, see the reference page for
In many instances (when the data grid or image is based on latitude and longitude and is aligned with the geographic graticule), a referencing matrix has more degrees of freedom than the data requires. In such cases, you may encounter a more compact representation, a three-element referencing vector. A referencing vector defines the pixel size and northwest origin for a regular, rectangular data grid:
refvec = [cells-per-degree north-lat west-lon]
In MAT-files, this variable is often called
The first element, cells-per-degree, describes the angular extent
of each grid cell (e.g., if each cell covers five degrees of latitude
and longitude, cells-per-degree would be specified as
Note that if the latitude extent of cells differs from their longitude
extent you cannot use a referencing vector, and instead must specify
a referencing object or matrix. The second element, north-lat, specifies
the northern limit of the data grid (as a latitude), and the third
element, west-lon, specifies the western extent of the data grid (as
a longitude). In other words, north-lat, west-lon is the northwest
corner of the data grid. Note, however, that cell (1,1) is always
in the southwest corner of the grid. This need not be the case for
grids or images described by referencing objects or matrices.
All regular data grids require a referencing object, matrix, or vector, even if they cover the entire planet. Geolocated data grids do not, as they explicitly identify the geographic coordinates of all rows and columns. For details on geolocated grids, see Geolocated Data Grids.