Geo::GDAL  2.4
Geo::GDAL::Dataset Class Reference

A set of associated raster bands or vector layer source.
More...

+ Inheritance diagram for Geo::GDAL::Dataset:
+ Collaboration diagram for Geo::GDAL::Dataset:

Public Member Functions

public method AddBand (scalar datatype= 'Byte', hashref options={})
 
public method AdviseRead ()
 
public Geo::GDAL::Band Band (scalar index)
 
public list Bands ()
 
public method BuildOverviews (scalar resampling, arrayref overviews, coderef progress, scalar progress_data)
 
public Geo::GDAL::Dataset BuildVRT (scalar Dest, arrayref Sources, hashref Options, coderef progress, scalar progress_data)
 
public method CommitTransaction ()
 
public Geo::GDAL::ColorTable ComputeColorTable (hash params)
 
public Geo::OGR::Layer CopyLayer (scalar layer, scalar name, hashref options=undef)
 
public Geo::OGR::Layer CreateLayer (hash params)
 Create a new vector layer into this dataset.

More...
 
public method CreateMaskBand ()
 
public Geo::GDAL::Dataset DEMProcessing (scalar Dest, scalar Processing, scalar ColorFilename, hashref Options, coderef progress, scalar progress_data)
 
public method Dataset ()
 
public method DeleteLayer (scalar name)
 
public Geo::GDAL::Band Dither (hash params)
 
public method Domains ()
 
public Geo::GDAL::Driver Driver ()
 
public Geo::OGR::Layer ExecuteSQL (scalar statement, scalar geom=undef, scalar dialect="")
 
public Geo::GDAL::Extent Extent (array params)
 
public list GCPs (array GCPs, Geo::OSR::SpatialReference sr)
 
public Geo::GDAL::GeoTransform GeoTransform (Geo::GDAL::GeoTransform scalar geo_transform)
 
public method GetDriver ()
 
public list GetFileList ()
 
public scalar GetGCPProjection ()
 
public Geo::OGR::Layer GetLayer (scalar name)
 
public list GetLayerNames ()
 
public method GetNextFeature ()
 
public method GetStyleTable ()
 
public Geo::GDAL::Dataset Grid (scalar Dest, hashref Options)
 
public scalar Info (hashref Options)
 
public Geo::GDAL::Dataset Nearblack (scalar Dest, hashref Options, coderef progress, scalar progress_data)
 
public Geo::GDAL::Dataset Open ()
 
public Geo::GDAL::Dataset OpenShared ()
 
public Geo::GDAL::Dataset Rasterize (scalar Dest, hashref Options, coderef progress, scalar progress_data)
 
public scalar ReadRaster (hash params)
 
public method ReadTile ()
 
public method ReleaseResultSet (scalar layer)
 
public method ResetReading ()
 
public method RollbackTransaction ()
 
public method SetStyleTable ()
 
public list Size ()
 
public Geo::OSR::SpatialReference SpatialReference (Geo::OSR::SpatialReference sr)
 
public method StartTransaction ()
 
public method TestCapability ()
 
public method Tile (Geo::GDAL::Extent e)
 
public Geo::GDAL::Dataset Translate (scalar Dest, hashref Options, coderef progress, scalar progress_data)
 
public Geo::GDAL::Dataset Warp (scalar Dest, hashref Options, coderef progress, scalar progress_data)
 
public Geo::GDAL::Dataset Warped (hash params)
 
public method WriteRaster (hash params)
 
public method WriteTile ()
 
- Public Member Functions inherited from Geo::GDAL::MajorObject
public scalar Description (scalar description)
 
public method Domains ()
 
public scalar GetDescription ()
 
public hash reference GetMetadata (scalar domain="")
 
public method GetMetadataDomainList ()
 
public hash reference Metadata (hashref metadata=undef, scalar domain= '')
 
public method SetDescription (scalar NewDesc)
 
public method SetMetadata (hashref metadata, scalar domain="")
 
- Public Member Functions inherited from Geo::GDAL
public method ApplyVerticalShiftGrid ()
 
public method BuildVRT ()
 
public method CPLBinaryToHex ()
 
public method CPLHexToBinary ()
 
public method CreatePansharpenedVRT ()
 
public scalar DataTypeIsComplex (scalar DataType)
 
public list DataTypeValueRange (scalar DataType)
 
public list DataTypes ()
 
public scalar DecToDMS (scalar angle, scalar axis, scalar precision=2)
 
public scalar DecToPackedDMS (scalar dec)
 
public method DontUseExceptions ()
 
public Geo::GDAL::Driver Driver (scalar Name)
 
public list DriverNames ()
 
public list Drivers ()
 
public method EscapeString ()
 
public scalar FindFile (scalar basename)
 
public method FinderClean ()
 
public method GOA2GetAccessToken ()
 
public method GOA2GetAuthorizationURL ()
 
public method GOA2GetRefreshToken ()
 
public method GetActualURL ()
 
public scalar GetCacheMax ()
 
public scalar GetCacheUsed ()
 
public scalar GetConfigOption (scalar key)
 
public scalar GetDataTypeSize (scalar DataType)
 
public method GetErrorCounter ()
 
public method GetFileSystemOptions ()
 
public method GetFileSystemsPrefixes ()
 
public method GetJPEG2000StructureAsString ()
 
public method GetSignedURL ()
 
public Geo::GDAL::Driver IdentifyDriver (scalar path, scalar siblings)
 
public method IdentifyDriverEx ()
 
public method MkdirRecursive ()
 
public Geo::GDAL::Dataset Open (hash params)
 
public Geo::GDAL::Dataset OpenEx (hash params)
 
public list OpenFlags ()
 
public scalar PackCharacter (scalar DataType)
 
public scalar PackedDMSToDec (scalar packed)
 
public method PopFinderLocation ()
 
public method PushFinderLocation (scalar path)
 
public list RIOResamplingTypes ()
 
public list ResamplingTypes ()
 
public method RmdirRecursive ()
 
public method SetCacheMax (scalar Bytes)
 
public method SetConfigOption (scalar key, scalar value)
 
public method UseExceptions ()
 
public method VSICurlClearCache ()
 
public method VSIFEofL ()
 
public method VSIFOpenExL ()
 
public method VSIGetLastErrorMsg ()
 
public method VSIGetLastErrorNo ()
 
public scalar VersionInfo (scalar request= 'VERSION_NUM')
 
public scalar errstr ()
 

Public Attributes

scalar RasterCount
 scalar (access as $dataset->{RasterCount})


 
scalar RasterXSize
 scalar (access as $dataset->{RasterXSize})


 
scalar RasterYSize
 scalar (access as $dataset->{RasterYSize})


 

Detailed Description

A set of associated raster bands or vector layer source.



Definition at line 3332 of file all.dox.

Constructor & Destructor Documentation

public method Geo::GDAL::Dataset::Dataset ( )


Code:
click to view

Member Function Documentation

public method Geo::GDAL::Dataset::AddBand ( scalar  datatype = 'Byte',
hashref  options = {} 
)

Object method.
Add a new band to the dataset. The driver must support the action.

Parameters
datatypeGDAL raster cell data type (one of those listed by Geo::GDAL::DataTypes).
optionsreference to a hash of format specific options.
Returns
The added band.

Code:
click to view

public method Geo::GDAL::Dataset::AdviseRead ( )


Code:
click to view

public Geo::GDAL::Band Geo::GDAL::Dataset::Band ( scalar  index)

Object method.
Create a band object for the band within the dataset.

Note
a.k.a. GetRasterBand
Parameters
index1...RasterCount, default is 1.
Returns
a new Geo::GDAL::Band object

Code:
click to view

public list Geo::GDAL::Dataset::Bands ( )

Object method.

Returns
a list of new Geo::GDAL::Band objects

Code:
click to view

public method Geo::GDAL::Dataset::BuildOverviews ( scalar  resampling,
arrayref  overviews,
coderef  progress,
scalar  progress_data 
)

Object method.

Parameters
resamplingthe resampling method, one of Geo::GDAL::RIOResamplingTypes.
overviewsThe list of overview decimation factors to
build. For example [2,4,8].
progress[optional] a reference to a subroutine, which will
be called with parameters (number progress, string msg, progress_data)
progress_data[optional]

Code:
click to view

public Geo::GDAL::Dataset Geo::GDAL::Dataset::BuildVRT ( scalar  Dest,
arrayref  Sources,
hashref  Options,
coderef  progress,
scalar  progress_data 
)

Object method.
Build a virtual dataset from a set of datasets.

Parameters
DestDestination raster dataset definition string (typically
filename), or an object, which implements write and close.
SourcesA list of filenames of input datasets or a list of
dataset objects.
OptionsSee section Processing options.
Returns
Dataset object

Note
This subroutine is imported into the main namespace if Geo::GDAL
is use'd with qw/:all/.

Code:
click to view

public method Geo::GDAL::Dataset::CommitTransaction ( )


Code:
click to view

public Geo::GDAL::ColorTable Geo::GDAL::Dataset::ComputeColorTable ( hash  params)

Object method.
Compute a color table from an RGB image

Parameters
paramsNamed parameters:
- Red The red band, the default is to use the red band of this dataset.
- Green The green band, the default is to use the green band of this dataset.
- Blue The blue band, the default is to use the blue band of this dataset.
- NumColors The number of colors in the computed color table. Default is 256.
- Progress reference to a progress function (default is undef)
- ProgressData (default is undef)
- Method The computation method. The default and currently only option is the median cut algorithm.

Returns
a new color table object.

Code:
click to view

public Geo::OGR::Layer Geo::GDAL::Dataset::CopyLayer ( scalar  layer,
scalar  name,
hashref  options = undef 
)

Object method.

Parameters
layerA Geo::OGR::Layer object to be copied.
nameA name for the new layer.
optionsA ref to a hash of format specific options.
Returns
a new Geo::OGR::Layer object.

Code:
click to view

public Geo::OGR::Layer Geo::GDAL::Dataset::CreateLayer ( hash  params)

Create a new vector layer into this dataset.

Object method.

Parameters
%paramsNamed parameters:
- Name (scalar) name for the new layer.
- Fields (array reference) a list of (scalar and geometry) field definitions as in
Geo::OGR::Layer::CreateField.
- ApproxOK (boolean value, default is true) a flag, which is forwarded to Geo::OGR::Layer::CreateField.
- Options (hash reference) driver specific hash of layer creation options.
- Schema (hash reference, deprecated, use Fields and Name) may contain keys Name, Fields, GeomFields, GeometryType.
- SRS (scalar) the spatial reference for the default geometry field.
- GeometryType (scalar) the type of the default geometry field
(if only one geometry field). Default is 'Unknown'.

Note
If Fields or Schema|Fields is not given, a default geometry
field (Name => '', GeometryType => 'Unknown') is created. If it is
given and it contains spatial fields, both GeometryType and SRS are
ignored. The type can be also set with the named parameter.

Example:
<br>my $roads = Geo::OGR::Driver('Memory')->Create('road')->
<br> Fields => [ { Name => 'class',
<br> Type => 'Integer' },
<br> { Name => 'geom',
<br> Type => 'LineString25D' } ] );
<br>


Many formats allow only one spatial field, which currently
requires the use of GeometryType.

Returns
a new Geo::OGR::Layer object.

Code:
click to view

public method Geo::GDAL::Dataset::CreateMaskBand ( )

Object method.
Add a mask band to the dataset.

Code:
click to view

public method Geo::GDAL::Dataset::DeleteLayer ( scalar  name)

Object method.
Deletes a layer from the data source. Note that if there is a layer
object for the deleted layer, it becomes unusable.

Parameters
namename of the layer to delete.

Code:
click to view

public Geo::GDAL::Dataset Geo::GDAL::Dataset::DEMProcessing ( scalar  Dest,
scalar  Processing,
scalar  ColorFilename,
hashref  Options,
coderef  progress,
scalar  progress_data 
)

Object method.
Apply a DEM processing to this dataset.

Parameters
DestDestination raster dataset definition string (typically filename) or an object, which implements write and close.
ProcessingProcessing to apply, one of "hillshade", "slope", "aspect", "color-relief", "TRI", "TPI", or "Roughness".
ColorFilenameThe color palette for color-relief.
OptionsSee section Processing options.
progress[optional] A reference to a subroutine, which will
be called with parameters (number progress, string msg, progress_data).
progress_data[optional]


Code:
click to view

public Geo::GDAL::Band Geo::GDAL::Dataset::Dither ( hash  params)

Object method.
Compute one band with color table image from an RGB image
params Named parameters:
- Red The red band, the default is to use the red band of this dataset.
- Green The green band, the default is to use the green band of this dataset.
- Blue The blue band, the default is to use the blue band of this dataset.
- Dest The destination band. If this is not defined, a new in-memory band (and a dataset) will be created.
- ColorTable The color table for the result. If this is not defined, and the destination band does not contain one, it will be computed with the ComputeColorTable method.
- Progress Reference to a progress function (default is undef). Note that if ColorTable is computed using ComputeColorTable method, the progress will run twice from 0 to 1.
- ProgressData (default is undef)

Returns
the destination band.

Usage example. This code converts an RGB JPEG image into a one band PNG image with a color table.
<br>my $d = Geo::GDAL::Open('pic.jpg');
<br>Geo::GDAL::Driver('PNG')->Copy(Name => 'test.png', Src => $d->Dither->Dataset);
<br>


Code:
click to view

public method Geo::GDAL::Dataset::Domains ( )


Code:
click to view

Object method.

Note
a.k.a. GetDriver
Returns
a Geo::GDAL::Driver object that was used to open or create this dataset.

Code:
click to view

public Geo::OGR::Layer Geo::GDAL::Dataset::ExecuteSQL ( scalar  statement,
scalar  geom = undef,
scalar  dialect = "" 
)

Object method.

Parameters
statementA SQL statement.
geomA Geo::OGR::Geometry object.
dialect
Returns
a new Geo::OGR::Layer object. The data source object will
exist as long as the layer object exists.

Code:
click to view

Object method.

Parameters
paramsnothing, or a list ($xoff, $yoff, $w, $h)
Returns
A new Geo::GDAL::Extent object that represents the area that
this raster or the specified tile covers.

Code:
click to view

public list Geo::GDAL::Dataset::GCPs ( array  GCPs,
Geo::OSR::SpatialReference  sr 
)

Object method.
Get or set the GCPs and their projection.

Parameters
GCPs[optional] a list of Geo::GDAL::GCP objects
sr[optional] the projection of the GCPs.
Returns
a list of Geo::GDAL::GCP objects followed by a Geo::OSR::SpatialReference object.

Code:
click to view

Object method.
Transformation from cell coordinates (column,row) to projection
coordinates (x,y)

<br>x = geo_transform[0] + column*geo_transform[1] + row*geo_transform[2]
<br>y = geo_transform[3] + column*geo_transform[4] + row*geo_transform[5]
<br>


Parameters
geo_transform[optional]
Returns
the geo transform in a non-void context.

Code:
click to view

public method Geo::GDAL::Dataset::GetDriver ( )


Code:
click to view

public list Geo::GDAL::Dataset::GetFileList ( )

Object method.

Returns
list of files GDAL believes to be part of this dataset.

Code:
click to view

public scalar Geo::GDAL::Dataset::GetGCPProjection ( )

Object method.

Returns
projection string.

Code:
click to view

public Geo::OGR::Layer Geo::GDAL::Dataset::GetLayer ( scalar  name)

Object method.

Parameters
namethe name of the requested layer. If not given, then
returns the first layer in the data source.
Returns
a new Geo::OGR::Layer object that represents the layer
in the data source.

Code:
click to view

public list Geo::GDAL::Dataset::GetLayerNames ( )

Object method.

Note
Delivers the functionality of undocumented method GetLayerCount.
Returns
a list of the names of the layers this data source provides.

Code:
click to view

public method Geo::GDAL::Dataset::GetNextFeature ( )


Code:
click to view

public method Geo::GDAL::Dataset::GetStyleTable ( )


Code:
click to view

public Geo::GDAL::Dataset Geo::GDAL::Dataset::Grid ( scalar  Dest,
hashref  Options 
)

Object method.
Creates a regular raster grid from this data source.
This is equivalent to the gdal_grid utility.

Parameters
DestDestination raster dataset definition string (typically
filename) or an object, which implements write and close.
OptionsSee section Processing options.

Code:
click to view

public scalar Geo::GDAL::Dataset::Info ( hashref  Options)

Object method.
Information about this dataset.

Parameters
OptionsSee section Processing options.

Code:
click to view

public Geo::GDAL::Dataset Geo::GDAL::Dataset::Nearblack ( scalar  Dest,
hashref  Options,
coderef  progress,
scalar  progress_data 
)

Object method.
Convert nearly black/white pixels to black/white.

Parameters
DestDestination raster dataset definition string (typically
filename), destination dataset to which to add an alpha or mask
band, or an object, which implements write and close.
OptionsSee section Processing options.
Returns
Dataset if destination dataset definition string was given,
otherwise a boolean for success/fail but the method croaks if there
was an error.

Code:
click to view

public Geo::GDAL::Dataset Geo::GDAL::Dataset::Open ( )

Package subroutine.
The same as Geo::GDAL::Open

Code:
click to view

public Geo::GDAL::Dataset Geo::GDAL::Dataset::OpenShared ( )

Package subroutine.
The same as Geo::GDAL::OpenShared

Code:
click to view

public Geo::GDAL::Dataset Geo::GDAL::Dataset::Rasterize ( scalar  Dest,
hashref  Options,
coderef  progress,
scalar  progress_data 
)

Object method.
Render data from this data source into a raster.

Parameters
DestDestination raster dataset definition string (typically
filename), destination dataset, or an object, which implements write and close.
OptionsSee section Processing options.
Returns
Dataset if destination dataset definition string was given,
otherwise a boolean for success/fail but the method croaks if there
was an error.


Code:
click to view

public scalar Geo::GDAL::Dataset::ReadRaster ( hash  params)

Object method.
Read data from the dataset.

Parameters
paramsNamed parameters:
- XOff x offset (cell coordinates) (default is 0)
- YOff y offset (cell coordinates) (default is 0)
- XSize width of the area to read (default is the width of the dataset)
- YSize height of the area to read (default is the height of the dataset)
- BufXSize (default is undef, i.e., the same as XSize)
- BufYSize (default is undef, i.e., the same as YSize)
- BufType data type of the buffer (default is the data type of the first band)
- BandList a reference to an array of band indices (default is [1])
- BufPixelSpace (default is 0)
- BufLineSpace (default is 0)
- BufBandSpace (default is 0)
- ResampleAlg one of Geo::GDAL::RIOResamplingTypes (default is 'NearestNeighbour'),
- Progress reference to a progress function (default is undef)
- ProgressData (default is undef)

Entry in GDAL docs (method RasterIO)
Returns
a buffer, open the buffer with unpack function of Perl. See Geo::GDAL::Band::PackCharacter.

Code:
click to view

public method Geo::GDAL::Dataset::ReadTile ( )


Code:
click to view

public method Geo::GDAL::Dataset::ReleaseResultSet ( scalar  layer)

Object method.

Parameters
layerA layer the has been created with ExecuteSQL.
Note
There is no need to call this method. The result set layer is
released in the destructor of the layer that was created with SQL.

Code:
click to view

public method Geo::GDAL::Dataset::ResetReading ( )


Code:
click to view

public method Geo::GDAL::Dataset::RollbackTransaction ( )


Code:
click to view

public method Geo::GDAL::Dataset::SetStyleTable ( )


Code:
click to view

public list Geo::GDAL::Dataset::Size ( )

Object method.

Returns
(width, height)

Code:
click to view

public Geo::OSR::SpatialReference Geo::GDAL::Dataset::SpatialReference ( Geo::OSR::SpatialReference  sr)

Object method.
Get or set the projection of this dataset.

Parameters
sr[optional] a Geo::OSR::SpatialReference object,
which replaces the existing projection definition of this dataset.
Returns
a Geo::OSR::SpatialReference object, which represents the
projection of this dataset.
Note
Methods GetProjection, SetProjection, and Projection return WKT strings.

Code:
click to view

public method Geo::GDAL::Dataset::StartTransaction ( )


Code:
click to view

public method Geo::GDAL::Dataset::TestCapability ( )


Code:
click to view

public method Geo::GDAL::Dataset::Tile ( Geo::GDAL::Extent  e)

Object method.
Compute the top left cell coordinates and width and height of the
tile that covers the given extent.

Parameters
eThe extent whose tile is needed.
Note
Requires that the raster is a strictly north up one.
Returns
A list ($xoff, $yoff, $xsize, $ysize).

Code:
click to view

public Geo::GDAL::Dataset Geo::GDAL::Dataset::Translate ( scalar  Dest,
hashref  Options,
coderef  progress,
scalar  progress_data 
)

Object method.
Convert this dataset into another format.

Parameters
DestDestination dataset definition string (typically
filename) or an object, which implements write and close.
OptionsSee section Processing options.
Returns
New dataset object if destination dataset definition
string was given, otherwise a boolean for success/fail but the
method croaks if there was an error.

Code:
click to view

public Geo::GDAL::Dataset Geo::GDAL::Dataset::Warp ( scalar  Dest,
hashref  Options,
coderef  progress,
scalar  progress_data 
)

Object method.
Reproject this dataset.

Parameters
DestDestination raster dataset definition string (typically
filename) or an object, which implements write and close.
OptionsSee section Processing options.
Note
This method can be run as a package subroutine with a list of
datasets as the first argument to mosaic several datasets.

Code:
click to view

public Geo::GDAL::Dataset Geo::GDAL::Dataset::Warped ( hash  params)

Object method.
Create a virtual warped dataset from this dataset.

Parameters
paramsNamed parameters:
- SrcSRS Override the spatial reference system of this dataset if there is one (default is undef).
- DstSRS The target spatial reference system of the result (default is undef).
- ResampleAlg The resampling algorithm (default is 'NearestNeighbour').
- MaxError Maximum error measured in input cellsize that is allowed in approximating the transformation (default is 0 for exact calculations).

# Documentation for GDAL warper.

Returns
a new Geo::GDAL::Dataset object

Code:
click to view

public method Geo::GDAL::Dataset::WriteRaster ( hash  params)

Object method.
Write data into the dataset.

Parameters
paramsNamed parameters:
- XOff x offset (cell coordinates) (default is 0)
- YOff y offset (cell coordinates) (default is 0)
- XSize width of the area to write (default is the width of the dataset)
- YSize height of the area to write (default is the height of the dataset)
- Buf a buffer (or a reference to a buffer) containing the data. Create the buffer with pack function of Perl. See Geo::GDAL::Band::PackCharacter.
- BufXSize (default is undef, i.e., the same as XSize)
- BufYSize (default is undef, i.e., the same as YSize)
- BufType data type of the buffer (default is the data type of the first band)
- BandList a reference to an array of band indices (default is [1])
- BufPixelSpace (default is 0)
- BufLineSpace (default is 0)
- BufBandSpace (default is 0)

Entry in GDAL docs (method RasterIO)

Code:
click to view

public method Geo::GDAL::Dataset::WriteTile ( )


Code:
click to view


The documentation for this class was generated from the following file: