Main Content
matlab.io.hdfeos.gd.defPixReg
Namespace: matlab.io.hdfeos.gd
Define pixel registration within grid
Syntax
defPixReg(gridID,pixRegCode)
Description
defPixReg(gridID,pixRegCode)
defines whether
the pixel center or pixel corner is used when requesting the location
(longitude and latitude) of a given pixel. pixRegCode
can
be one of the following values.
'center' | Center of pixel cell |
'corner' | Corner of pixel cell |
If this routine is not invoked, the pixel registration is 'center'
.
This function corresponds to the GDdefpixreg
function
in the HDF-EOS library.
Examples
Define a grid with pixel registration in the center.
import matlab.io.hdfeos.* gfid = gd.open('myfile.hdf','create'); gridID = gd.create(gfid,'PolarGrid',100,100,[],[]); projparm = zeros(1,13); projparm(6) = 90000000; gd.defProj(gridID,'ps',[],'WGS 84',projparm); gd.defPixReg(gridID,'corner'); gd.detach(gridID); gd.close(gfid);