The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

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

SYNOPSIS

DESCRIPTION

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

METHODS

GetDataType

 my $datatype = $band->GetDataType;

GetSize

 my @size = $band->GetSize;

GetBlockSize

 my @size = $band->GetBlockSize;

GetNoDataValue

 my $nodata = $band->GetNoDataValue;

SetNoDataValue

 $band->SetNoDataValue($value);

Calling the method without arguments deletes the nodata value.

 $band->SetNoDataValue;

Read

 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.

ReadBlock

 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.

Write

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

WriteBlock

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

SetPiddle

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

Read data from a piddle into this Band.

GetPiddle

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

Read data from this Band into a piddle.

GetColorInterpretation

 my $ci = $band->GetColorInterpretation;

SetColorInterpretation

 $band->SetColorInterpretation($ci);

GetColorTable

 my $color_table = $band->GetColorTable;

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

SetColorTable

 $band->GetColorTable($color_table);

LICENSE

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

AUTHOR

Ari Jolma - Ari.Jolma at gmail.com

SEE ALSO

Geo::GDAL::FFI

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