Geo::G...::Band(3pm)
π Geo::GDAL::FFI::Band π
okay bestie, sit down, hydrate, because today we're talking about a band β and no, not the kind with guitars. this is Geo::GDAL::FFI::Band, a GDAL raster band, straight out of the User Contributed Perl Documentation. it's giving pixels. it's giving channels. it's giving main character energy for your raster data. π
β¨ SYNOPSIS β¨
sooo the original page just. doesn't have one. no synopsis. nothing. an empty vibe. π lowkey iconic of it honestly. we go straight into the lore.
πΈ DESCRIPTION πΈ
a band (aka a channel, bestie, same thing) inside a raster dataset. π¦
to get one, you use the Band method of a dataset object. that's it. that's the door. knock on it and a band object appears in your hands like magic. β¨
π METHODS π
GetDataType
my $datatype = $band->GetDataType;
gives you the datatype. no notes. slay. β
GetSize
my @size = $band->GetSize;
hands you the size. plural, because it's a list, because of course it is. π«Ά
GetBlockSize
my @size = $band->GetBlockSize;
same energy as GetSize but for the block size. the way that blocks have their own whole size?? obsessed. π
GetNoDataValue
my $nodata = $band->GetNoDataValue;
fetches the nodata value β the lil "this pixel is literally nothing" marker. πββοΈ
SetNoDataValue
$band->SetNoDataValue($value);
sets the nodata value to $value. and here's the fun part bestie:
if you call this method without any arguments, it deletes the nodata value. poof. gone. π«§
$band->SetNoDataValue;
no args = no nodata. periodt.
Read
my $data = $band->Read($xoff, $yoff, $xsize, $ysize, $bufxsize, $bufysize);
all the arguments are optional, which is so generous of it honestly.
if you give it no arguments at all, it reads the whole raster band into a 2D Perl array. π and heads up on the shape: the returned array is an array of references to arrays of row values. array of arrayrefs of rows. iykyk. π
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 (which is an integer, btw, don't come at me with a string) are both optional β if you don't pass them, they get obtained from the GDAL raster object. it just knows. π
Write
$band->Write($data, $xoff, $yoff, $xsize, $ysize);
write time. put the data in, tell it where, done. π«
WriteBlock
$band->WriteBlock($data, $xoff, $yoff);
the block-flavored version of writing. smaller, punchier, still eating. π
SetPiddle
$band->SetPiddle($pdl, $xoff, $yoff, $xsize, $ysize);
reads data from a piddle into this Band. piddle in, band updated. the crossover episode we deserved. π§
GetPiddle
$band->GetPiddle($xoff, $yoff, $xsize, $ysize, $xdim, $ydim);
reads data from this Band into a piddle. reverse uno. π and yes it takes $xdim and $ydim too. β¨
GetColorInterpretation
my $ci = $band->GetColorInterpretation;
returns the color interpretation. what is this band, color-wise? now you know. π
SetColorInterpretation
$band->SetColorInterpretation($ci);
sets the color interpretation to $ci. glow up your band's identity. π
GetColorTable
my $color_table = $band->GetColorTable;
returns the color table as an array of arrays. π¦ the inner tables are colors written as [c1...c4]. so like, arrays within arrays within vibes. no cap.
SetColorTable
$band->SetColorTable($color_table);
give it a $color_table and it sets it. done and dusted. π
π LICENSE π
this software is released under the Artistic License. see perlartistic for the full tea. β
π AUTHOR π
Ari Jolma β Ari.Jolma at gmail.com
π SEE ALSO π
Geo::GDAL::FFIAlien::gdalFFI::Platypus<http://www.gdal.org>
and that's the whole page bestie!! π₯³ you read all of it, i'm so proud, genuinely. this was perl v5.42.3 energy, dated 2026-08-21, from the User Contributed Perl Documentation crew. mwah. take care of your bands. πβ¨π¦ππ
π¦ where this page comes from
- ubuntu stonking: libgeo-gdal-ffi-perl 0.16-1build2 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms