Wrapping class for GDALRasterBand C++ API exporting GetBlockXSize, GetBlockYSize, ReadBlock, WriteBlock for better IO speed.
new()
Creates a new GDALRasterBand
GDALRasterBand$new(band)
band
The C++ pointer to the GDALRasterBandR object.
datatype
The GDALDataType for this band
An object of GDALRasterBand R6 class
ReadBlock()
Efficiently reads a raster block
GDALRasterBand$ReadBlock(iXBlock, iYBlock)
iXBlock
Integer. The i-th column block to access. The iXBlock
will be offset
\( BLOCKXSIZE \times iXBlock \) from the origin.
iYBlock
Integer. The i-th row block to access. The iYBlock
will be offset
\( BLOCKYSIZE \times iYBlock \) from the origin.
The returned Vector will be single dimensional with the length \( BLOCKXSIZE \times BLOCKYSIZE \). If you use matrix(, ncol=BLOCKXSIZE) the matrix returned will actually be transposed. You should either transpose it or you can calculate the indices using \( y \cdot xsize + x \)
RawVector for GDALDataType$GDT_Byte, IntegerVector for int types and NumericVector for floating point types.
WriteBlock()
Efficiently writes a raster block
GDALRasterBand$WriteBlock(iXBlock, iYBlock, buffer)
iXBlock
Integer. The i-th column block to write. The iXBlock
will be
offset \( BLOCKXSIZE \times iXBlock \) from the origin.
iYBlock
Integer. The i-th row block to write. The iYBlock
will be offset
\( BLOCKYSIZE \times iYBlock \) from the origin.
buffer
RawVector/IntegerVector/NumericVector depending on the GDALDataType. This should be a 1D vector with size equal to raster \( BLOCKXSIZE \times BLOCKYSIZE \).
The returned Vector will be single dimensional with the length \( BLOCKXSIZE \times BLOCKYSIZE \). If you use matrix(, ncol=BLOCKXSIZE) the matrix returned will actually be transposed. You should either transpose it or you can calculate the indices using \( y \cdot xsize + x \).
Nothing
GetBlockXSize()
Get the block width
GDALRasterBand$GetBlockXSize()
An integer indicating block width
GetBlockYSize()
Get the block height
GDALRasterBand$GetBlockYSize()
An integer indicating block height
GetXSize()
Get the band width
GDALRasterBand$GetXSize()
An integer indicating band width
CalculateStatistics()
Calculate statistics for the GDALRasterBand
GDALRasterBand$CalculateStatistics()
nothing
GetYSize()
Get the band height
GDALRasterBand$GetYSize()
An integer indicating band height
GetNoDataValue()
Get band no data value
GDALRasterBand$GetNoDataValue()
Numeric indicating no data value
GetRasterDataType()
Get band datatype
GDALRasterBand$GetRasterDataType()
Numeric indicating the datatype
clone()
The objects of this class are cloneable with this method.
GDALRasterBand$clone(deep = FALSE)
deep
Whether to make a deep clone.