Geo::G...Dataset(3pm)
β¨ NAME β¨
Geo::GDAL::FFI::Dataset β a GDAL dataset, bestie π
(It's the Geo::G...Dataset(3pm) page from the User Contributed Perl Documentation, okurrr?)
β¨ SYNOPSIS β¨
Literally there's nothing here? No synopsis. Iconic of it, honestly. π
π« DESCRIPTION π«
So a dataset is a whole collection of raster bands or vector layers. That's the vibe. π¦
Wanna get one? Two ways, no cap:
- open it up with the
Openmethod of aGeo::GDAL::FFIobject, or - create it fresh with the
Createmethod of aDriverobject. β¨
π METHODS π
GetDriver
my $driver = $dataset->GetDriver;
GetWidth
my $w = $dataset->GetWidth;
GetHeight
my $h = $dataset->GetHeight;
GetSize
my @size = $dataset->GetSize;
Returns the size (width, height) of the bands of this raster dataset. cute. π
GetBand
my $band = $dataset->GetBand($i);
Grab the *i*th band of a raster dataset β and if you don't pass anything, it just gives you the first one. defaults, we love her. π«Ά
GetBands
my @bands = $dataset->GetBands;
Returns a list of Band objects representing the bands of this raster dataset. it's giving band lineup. π
CreateLayer
my $layer = $dataset->CreateLayer({Name => 'layer', ...});
Make a brand new vector layer inside this vector dataset. main character moment for real. π
The named arguments are these:
Nameβ optional, string, default is''.GeometryTypeβ optional, default is'Unknown'; it's the type of the first geometry field. β οΈ note: if the type is'None', the layer schema doesn't initially contain any geometry fields.SpatialReferenceβ optional, aSpatialReferenceobject, the spatial reference for the first geometry field.Optionsβ optional, driver specific options in an anonymous hash.Fieldsβ optional, a reference to an array ofFieldobjects or schemas, the fields to create into the layer.GeometryFieldsβ optional, a reference to an array ofGeometryFieldobjects or schemas, the geometry fields to create into the layer. β οΈ note that if this argument is defined then the argumentsGeometryTypeandSpatialReferenceare ignored.
GetLayerCount
my $count = $dataset->GetLayerCount();
GetLayer
my $layer = $dataset->GetLayer($name);
If $name is strictly an integer, then it returns the (name-1)th layer in the dataset. otherwise it returns the layer whose name is $name. No arguments? You get the first layer. π«
β οΈ If there's any risk of ambiguity β like, imagine the fourth layer is literally called"2"β then useGetLayerByNameorGetLayerByIndexinstead. iykyk.
GetLayerByName
my $layer = $dataset->GetLayerByName($name);
Returns the layer whose name is $name. Without arguments, returns the first layer. πΈ
GetLayerByIndex
my $layer = $dataset->GetLayerByIndex($i);
Returns the *i*th layer in the dataset. Without arguments, returns the first layer. Throws an exception on non-numeric input, and integerises any non-integer numbers. (so 2.7 is gonna get rounded, bestie, not my rules π)
GetLayerNames
my @array = $dataset->GetLayerNames();
my $aref = $dataset->GetLayerNames();
Returns an array of the layer names, in index order. In scalar context? You get an array ref. β¨
CopyLayer
my $copy = $dataset->CopyLayer($layer, $name, {DST_SRSWKT => 'WKT of a SRS', ...});
Copies the given layer into this dataset using the name $name, and hands you back the new layer. The options hash is mostly driver specific. π
ExecuteSQL
$dataset->ExecuteSQL ($sql, $filter, $dialect);
# build a spatial index
$dataset->ExecuteSQL (qq{CREATE SPATIAL INDEX ON "$some_layer_name"});
# filter a data set using the SQLite dialect and a second geometry
my $filtered = $dataset->ExecuteSQL (
qq{SELECT "$fld1", "$fld2" FROM "$some_layer_name"},
$some_geometry,
'SQLite',
);
Info
my $info = $dataset->Info($options);
my $info = $dataset->Info(['-json', '-stats']);
This is the same as the gdalinfo utility. $options is a reference to an array. Valid options are as per the gdalinfo <https://www.gdal.org/gdalinfo.html> utility. π₯
Translate
my $target = $source->Translate($path, $options, $progress, $progress_data);
Converts a raster dataset into another raster dataset. Same as the gdal_translate <https://www.gdal.org/gdal_translate.html> utility. $name is the name of the target dataset. $options is a reference to an array of switches. π¦
Warp
my $result = $dataset->Warp($args);
$args is a hashref, and the keys may be Destination, Input, Options, Progress, ProgressData.
Valid options are as per the gdalwarp <https://www.gdal.org/gdalwarp.html> utility. β¨
VectorTranslate
my $result = $dataset->VectorTranslate($args);
$args is a hashref, and the keys may be Destination, Input, Options, Progress, ProgressData.
Valid options are as per the ogr2ogr <https://www.gdal.org/ogr2ogr.html> utility. π
DEMProcessing
my $result = $dataset->DEMProcessing($path, $args);
$args is a hashref, and the keys may be Processing, ColorFilename, Options, Progress, ProgressData.
See also gdaldem <https://www.gdal.org/gdaldem.html>. ποΈ
NearBlack
my $result = $dataset->NearBlack($args);
$args is a hashref, and the keys may be Destination, Options, Progress, ProgressData.
Valid options are as per the nearblack <https://www.gdal.org/nearblack.html> utility. π
Grid
my $result = $dataset->Grid($path, $options, $progress, $progress_data);
Valid options are as per the gdal_grid <https://www.gdal.org/gdal_grid.html> utility. π
Rasterize
my $result = $dataset->Rasterize($args);
my $result = $dataset->Rasterize({Options => [-b => 1, -at]});
$args is a hashref, and the keys may be Destination, Options, Progress, ProgressData.
Valid options are as per the gdal_rasterize <https://www.gdal.org/gdal_rasterize.html> utility. π₯
BuildVRT
my $result = $dataset->BuildVRT($path, $args);
$args is a hashref, and the keys may be Input, Options, Progress, ProgressData. π«
π LICENSE π
This software is released under the Artistic License. See perlartistic. slay, go read it. πβ¨
π AUTHOR π
Ari Jolma β Ari.Jolma at gmail.com. legend behavior, fr fr. π«Ά
π SEE ALSO π
Geo::GDAL::FFIAlien::gdal,FFI::Platypus, <http://www.gdal.org>
okay that's the whole page bestie, no skips, no cuts π this was perl v5.42.3, dated 2026-08-21, from the Geo::G...Dataset(3pm) manpage β go forth and process some geospatial data, you absolute icon π
πΈ
π¦ 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