Referencing matrix to geographic raster reference object
R = refmatToGeoRasterReference(refmat,rasterSize)
R = refmatToGeoRasterReference(___,rasterInterpretation)
R = refmatToGeoRasterReference(___,funcName,varName,argIndex)
R = refmatToGeoRasterReference(Rin,rasterSize,___)
constructs
a cell-oriented geographic raster reference object, R
= refmatToGeoRasterReference(refmat
,rasterSize
)R
,
from a referencing matrix, refmat
, and a size vector, rasterSize
.
uses
the R
= refmatToGeoRasterReference(___,rasterInterpretation
)rasterInterpretation
input to determine which
type of geographic raster reference object to construct. The rasterInterpretation
input
indicates basic geometric nature of the raster, and can equal either 'cells'
or 'postings'
.
uses
up to three optional arguments to provide additional information.
This information is used to construct error messages if either the R
= refmatToGeoRasterReference(___,funcName
,varName
,argIndex
)refmat
or rasterSize
inputs
turn out to be invalid. Thus, you can use refmatToGeoRasterReference
for
both validating and converting a referencing matrix. The optional
inputs work just like their counterparts in the function validateattributes
.
verifies
that size of the geographic raster reference object, R
= refmatToGeoRasterReference(Rin
,rasterSize
,___)Rin
is
consistent with the size specified by rasterSize
,
and then copies Rin
to R
. refmatToGeoRasterReference
gets
size information from the Rin.RasterSize
property.
|
Any valid referencing matrix. The matrix must lead to valid
latitude and longitude limits when combined with |
|
Size vector R = refmatToGeoRasterReference(refmat, size(RGB)) where |
|
Basic geometric nature of the raster, specified as either |
|
Name used in the formatted error message to identify the function checking the input, specified as a character vector. |
|
Name used in the formatted error message to identify the referencing matrix, specified as a character vector. |
|
Positive integer that indicates the position of the referencing matrix checked in the function
argument list. |
|
Geographic raster reference object. |
|
Geographic raster reference object. |
Convert a referencing matrix to a geographic raster reference object:
% Specify the size of a sample raster and referencing matrix. rasterSize = [180 360]; refmat = [0 1; 1 0; -0.5 -90.5]; % Convert the referencing matrix to a % geographic raster reference object. R = refmatToGeoRasterReference(refmat,rasterSize); % For comparison, construct a referencing object directly. R2 = georasterref( ... 'RasterSize',rasterSize,'Latlim',[-90 90],'Lonlim',[0 360]);