Geo::GDAL::FFI::Band(3pm) User Contributed Perl Documentation Geo::GDAL::FFI::Band(3pm)

Geo::GDAL::FFI::Band - A GDAL raster band

A band (channel) in a raster dataset. Use the Band method of a dataset object to obtain a band object.

 my $datatype = $band->GetDataType;

 my @size = $band->GetSize;

 my @size = $band->GetBlockSize;

 my $nodata = $band->GetNoDataValue;

 $band->SetNoDataValue($value);

Calling the method without arguments deletes the nodata value.

 $band->SetNoDataValue;

 my $data = $band->Read($xoff, $yoff, $xsize, $ysize, $bufxsize, $bufysize);

All arguments are optional. If no arguments are given, reads the whole raster band into a 2D Perl array. The returned array is an array of references to arrays of row values.

 my $data = $band->ReadBlock($xoff, $yoff, @blocksize, $datatype);

Reads a block of data from the band and returns it as a Perl 2D array. @blocksize and $datatype (an integer) are optional and obtained from the GDAL raster object if not given.

 $band->Write($data, $xoff, $yoff, $xsize, $ysize);

 $band->WriteBlock($data, $xoff, $yoff);

 $band->SetPiddle($pdl, $xoff, $yoff, $xsize, $ysize);

Read data from a piddle into this Band.

 $band->GetPiddle($xoff, $yoff, $xsize, $ysize, $xdim, $ydim);

Read data from this Band into a piddle.

 my $ci = $band->GetColorInterpretation;

 $band->SetColorInterpretation($ci);

 my $color_table = $band->GetColorTable;

Returns the color table as an array of arrays. The inner tables are colors [c1...c4].

 $band->SetColorTable($color_table);

This software is released under the Artistic License. See perlartistic.

Ari Jolma - Ari.Jolma at gmail.com

Geo::GDAL::FFI

Alien::gdal, FFI::Platypus, <http://www.gdal.org>

2024-04-01 perl v5.38.2