Geo::G...::Band(3pm)

πŸ“¦
version 0.16 Β· 4 versions
, in ubuntu stonking

πŸ’– 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 πŸ”­


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