NAME

Geo::GDAL::FFI::Dataset - A GDAL dataset

SYNOPSIS

DESCRIPTION

A collection of raster bands or vector layers. Obtain a dataset object by opening it with the Open method of Geo::GDAL::FFI object or by creating it with the Create method of a Driver object.

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.

GetBand

my $band = $dataset->GetBand($i);

Get the ith (by default the first) band of a raster dataset.

GetBands

my @bands = $dataset->GetBands;

Returns a list of Band objects representing the bands of this raster dataset.

CreateLayer

my $layer = $dataset->CreateLayer({Name => 'layer', ...});

Create a new vector layer into this vector dataset.

Named arguments are the following.

Name

Optional, string, default is ''.

GeometryType

Optional, default is 'Unknown', the type of the first geometry field; note: if type is 'None', the layer schema does not initially contain any geometry fields.

SpatialReference

Optional, a SpatialReference object, the spatial reference for the first geometry field.

Options

Optional, driver specific options in an anonymous hash.

Fields

Optional, a reference to an array of Field objects or schemas, the fields to create into the layer.

GeometryFields

Optional, a reference to an array of GeometryField objects or schemas, the geometry fields to create into the layer; note that if this argument is defined then the arguments GeometryType and SpatialReference are ignored.

GetLayer

my $layer = $dataset->GetLayer($name);

If $name is strictly an integer, then returns the (name-1)th layer in the dataset, otherwise returns the layer whose name is $name. Without arguments returns the first layer.

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 returns the new layer. The options hash is mostly driver specific.

Info

my $info = $dataset->Info($options);

This is the same as gdalinfo utility. $options is a reference to an array.

Translate

my $target = $source->Translate($path, $options, $progress, $progress_data);

Convert a raster dataset into another raster dataset. This is the same as the gdal_translate utility. $name is the name of the target dataset. $options is a reference to an array.

Warp

my $result = $dataset->Warp($args);

$args is a hashref, keys may be Destination, Input, Options, Progress, ProgressData.

VectorTranslate

my $result = $dataset->VectorTranslate($args);

$args is a hashref, keys may be Destination, Input, Options, Progress, ProgressData.

DEMProcessing

my $result = $dataset->DEMProcessing($path, $args);

$args is a hashref, keys may be Processing, ColorFilename, Options, Progress, ProgressData.

NearBlack

my $result = $dataset->NearBlack($args);

$args is a hashref, keys may be Destination, Options, Progress, ProgressData.

Grid

my $result = $dataset->Grid($path, $options, $progress, $progress_data);

Rasterize

my $result = $dataset->Rasterize($args);

$args is a hashref, keys may be Destination, Options, Progress, ProgressData.

BuildVRT

my $result = $dataset->BuildVRT($path, $args);

$args is a hashref, keys may be Input, Options, Progress, ProgressData.

LICENSE

This software is released under the Artistic License. See perlartistic.

AUTHOR

Ari Jolma - Ari.Jolma at gmail.com

SEE ALSO

Geo::GDAL::FFI

Alien::gdal, FFI::Platypus, http://www.gdal.org