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

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

πŸŽ€ Geo::G...::Layer πŸŽ€

okay so picture this: you're deep in the User Contributed Perl Documentation section of your man pages, and you've landed on Geo::G...::Layer(3pm), aka the page for Geo::GDAL::FFI::Layer. it's giving vector-features-in-GDAL realness and honestly? we love her. let's get into it πŸ’…


✨ NAME ✨

Geo::GDAL::FFI::Layer β€” literally just: a collection of vector features in GDAL. that's the whole pitch, bestie. short, sweet, iconic πŸ’–


✨ SYNOPSIS ✨

okay so technically there is nothing under this heading. no code, no synopsis, nothing. the page just hits you with the vibe. not me pointing at the empty room like "look πŸ‘€". that's the whole synopsis. periodt. 🫢

✨ DESCRIPTION ✨

so a Layer is a set of (vector) features that all share the same schema β€” which is literally the same Defn object for every one of them. matching outfits, no cap πŸ‘‘

and how do you even get a layer object, you ask? easy: you call the CreateLayer or the GetLayer method on a vector dataset object. that's the door. that's the entrance. slay πŸ¦‹

⚠️ okay this part is important, so pay attention bestie ⚠️ the system keeps a reference to the parent dataset inside every layer object, and it does that so your layer objects stay viable and don't just evaporate. but here's the tea: if you're counting on a dataset object's destruction to flush its dataset cache and then close it, then you have to make sure that all of the associated child layers are destroyed too. if you don't? you could end up with corrupt data when reading in newly written files. πŸ’€ like, that's the bad ending. don't do it.

🌸 METHODS 🌸

GetDefn

my $defn = $layer->GetDefn;

hands you back the FeatureDefn object for this layer. the schema bestie, the blueprint, the moment πŸ’œ

ResetReading

$layer->ResetReading;

GetNextFeature

my $feature = $layer->GetNextFeature;

GetFeature

my $feature = $layer->GetFeature($fid);

SetFeature

$layer->SetFeature($feature);

CreateFeature

$layer->CreateFeature($feature);

DeleteFeature

$layer->DeleteFeature($fid);

GetFeatureCount

my $count = $layer->GetFeatureCount();

GetExtent

$layer->GetExtent();
$layer->GetExtent(1);

returns an array ref with [minx, miny, maxx, maxy]. and the argument? it's a boolean that forces the calculation even if it's expensive β€” highkey a "yeah I know it'll cost me, do it anyway" button πŸ”₯

Intersection, Union, SymDifference, Identity, Update, Clip, Erase

$result = $layer-><Method>($method, $args);

this runs the <method> algorithm between the layer and the method layer. they all share this same shape, so once you know one you know them all 🧚

named arguments are the following:

"Result"

optional β€” lets you define the result layer. main character move, tbh πŸ‘‘

"Options"

optional β€” lets you define the options (peep the GDAL docs for those, iykyk).

"Progress"

optional β€” the progress indicator callback. for when you need the little "we're getting there" updates ✨

"ProgressData"

optional β€” the data for the progress callback. the little care package that rides along with it πŸŽ€


🌈 LICENSE 🌈

this software is released under the Artistic License. see perlartistic. legally iconic, we adore her πŸ’…


πŸ’œ AUTHOR πŸ’œ

Ari Jolma β€” Ari.Jolma at gmail.com. give her the credit she deserves bestie πŸ™Œ


⭐ SEE ALSO ⭐


and that's the whole page, babe 🫢 this doc came to you as perl v5.42.3, dated 2026-08-21, straight from Geo::G...::Layer(3pm) β€” go forth and wrangle those vector features, you absolute legend πŸ’–βœ¨πŸ”₯

πŸ“¦ where this page comes from