Geo::G...::Layer(3pm)
π 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 β
Geo::GDAL::FFIAlien::gdalFFI::Platypus- <http://www.gdal.org>
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
- 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