Construct geographic raster reference object
Use the georefcells
function or the
georefpostings
function instead,
except when constructing a raster reference object from a world file
matrix.
R = georasterref(W,rasterSize)
R = georasterref(W,rasterSize,rasterInterpretation)
R = georasterref(Name,Value)
creates a reference object for a regular raster of cells in geographic coordinates
using the specified world file matrix R
= georasterref(W
,rasterSize
)W
and raster size
rasterSize
.
,
where R
= georasterref(W
,rasterSize
,rasterInterpretation
)rasterInterpretation
is 'postings'
,
specifies that the raster contains regularly posted samples in geographic
coordinates. The default for rasterInterpretation
is
'cells'
, which specifies a regular raster of
cells.
accepts
a list of name-value pairs that are used to assign selected properties
when initializing a geographic raster reference object.R
= georasterref(Name,Value
)
Construct a referencing object for a global raster comprising a grid of 180-by-360 one-degree cells, with rows that start at longitude -180, and with the first cell located in the northwest corner.
R = georasterref('RasterSize', [180 360], ... 'RasterInterpretation', 'cells', 'ColumnsStartFrom', 'north', ... 'LatitudeLimits', [-90 90], 'LongitudeLimits', [-180 180])
Construct a referencing object for the DTED Level 0 file that
includes Sagarmatha (Mount Everest). The DTED columns run from south
to north and the first column runs along the western edge of the (one-degree-by-one-degree)
quadrangle, consistent with the default values for 'ColumnsStartFrom'
and 'RowsStartFrom'
.
R = georasterref('LatitudeLimits',[27 28],'LongitudeLimits',[86 87], ... 'RasterSize', [121 121], 'RasterInterpretation', 'postings')
Repeat the second example with a different strategy: Create
an object by specifying only the RasterInterpretation
value,
then modify the object by resetting additional properties. (As noted
above, the RasterInterpretation
of an existing
raster reference object cannot be changed.)
R = georasterref('RasterInterpretation','postings'); R.RasterSize = [121 121]; R.LatitudeLimits = [27 28]; R.LongitudeLimits = [86 87];
Repeat the first example using a world file matrix as input.
W = [1 0 -179.5; ... 0 -1 89.5]; rasterSize = [180 360]; rasterInterpretation = 'cells'; R = georasterref(W, rasterSize, rasterInterpretation);