Geo::GDAL
2.1
|
A raster band. More...
Public Member Functions | |
public Geo::GDAL::RasterAttributeTable | AttributeTable (scalar AttributeTable) |
public list | CategoryNames (array names) |
public scalar | Checksum (scalar xoff=0, scalar yoff=0, scalar xsize=undef, scalar ysize=undef) |
public scalar | ColorInterpretation (scalar color_interpretation) |
public method | ColorInterpretations () |
public Geo::GDAL::ColorTable | ColorTable (scalar ColorTable) |
public method | ComputeBandStats (scalar samplestep=1) |
public method | ComputeRasterMinMax (scalar approx_ok=0) |
public list | ComputeStatistics (scalar approx_ok, scalar progress=undef, scalar progress_data=undef) |
public Geo::OGR::Layer | Contours (scalar DataSource, hashref LayerConstructor, scalar ContourInterval, scalar ContourBase, arrayref FixedLevels, scalar NoDataValue, scalar IDField, scalar ElevField, coderef Progress, scalar ProgressData) |
public method | CreateMaskBand (array flags) |
public scalar | DataType () |
public Geo::GDAL::Dataset | Dataset () |
public scalar | DeleteNoDataValue () |
public Geo::GDAL::Band | Distance (hash params) |
public method | Domains () |
public method | Fill (scalar real_part, scalar imag_part=0.0) |
public method | FillNoData (scalar mask, scalar max_search_dist, scalar smoothing_iterations, scalar options, coderef progress, scalar progress_data) |
public method | FlushCache () |
public scalar | GetBandNumber () |
public list | GetBlockSize () |
public list | GetDefaultHistogram (scalar force=1, coderef progress=undef, scalar progress_data=undef) |
public list | GetHistogram (hash parameters) |
public Geo::GDAL::Band | GetMaskBand () |
public list | GetMaskFlags () |
public scalar | GetMaximum () |
public scalar | GetMinimum () |
public Geo::GDAL::Band | GetOverview (scalar index) |
public scalar | GetOverviewCount () |
public list | GetStatistics (scalar approx_ok, scalar force) |
public method | HasArbitraryOverviews () |
public list | MaskFlags () |
public scalar | NoDataValue (scalar NoDataValue) |
public scalar | PackCharacter () |
public method | Piddle () |
public Geo::OGR::Layer | Polygonize (hash params) |
public method | RasterAttributeTable () |
public scalar | ReadRaster (hash params) |
public array reference | ReadTile (scalar xoff=0, scalar yoff=0, scalar xsize=< width >, scalar ysize=< height >) |
public method | RegenerateOverview (Geo::GDAL::Band overview, scalar resampling, coderef progress, scalar progress_data) |
public method | RegenerateOverviews (arrayref overviews, scalar resampling, coderef progress, scalar progress_data) |
public method | ScaleAndOffset (scalar scale, scalar offset) |
public list | SetDefaultHistogram (scalar min, scalar max, scalar histogram) |
public method | SetStatistics (scalar min, scalar max, scalar mean, scalar stddev) |
public Geo::GDAL::Band | Sieve (hash params) |
public list | Size () |
public method | Unit (scalar type) |
public method | WriteRaster (hash params) |
public method | WriteTile (scalar data, scalar xoff=0, scalar yoff=0) |
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 | 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 scalar | GetCacheMax () |
public scalar | GetCacheUsed () |
public scalar | GetConfigOption (scalar key) |
public scalar | GetDataTypeSize (scalar DataType) |
public method | GetJPEG2000StructureAsString () |
public Geo::GDAL::Driver | IdentifyDriver (scalar path, scalar siblings) |
public Geo::GDAL::Dataset | Open (hash params) |
public Geo::GDAL::Dataset | OpenEx (hash params) |
public list | OpenFlags () |
public Geo::GDAL::Dataset | OpenShared (scalar name, scalar access= 'ReadOnly') |
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 | SetCacheMax (scalar Bytes) |
public method | SetConfigOption (scalar key, scalar value) |
public method | UseExceptions () |
public method | VSIFOpenExL () |
public method | VSIGetLastErrorMsg () |
public method | VSIGetLastErrorNo () |
public scalar | VersionInfo (scalar request= 'VERSION_NUM') |
public scalar | errstr () |
Public Attributes | |
scalar | XSize |
Object attribute. scalar (access as $band->{XSize}) | |
scalar | YSize |
Object attribute. scalar (access as $band->{YSize}) | |
public Geo::GDAL::RasterAttributeTable Geo::GDAL::Band::AttributeTable | ( | scalar | AttributeTable | ) |
Object method.
AttributeTable | [optional] A Geo::GDAL::RasterAttributeTable object. |
public list Geo::GDAL::Band::CategoryNames | ( | array | names | ) |
Object method.
names | [optional] |
public scalar Geo::GDAL::Band::Checksum | ( | scalar | xoff = 0 , |
scalar | yoff = 0 , |
||
scalar | xsize = undef , |
||
scalar | ysize = undef |
||
) |
Object method. Computes a checksum from the raster or a part of it.
xoff | |
yoff | |
xsize | |
ysize |
public scalar Geo::GDAL::Band::ColorInterpretation | ( | scalar | color_interpretation | ) |
Object method.
color_interpretation | [optional] new color interpretation, one of Geo::GDAL::Band::ColorInterpretations. |
public method Geo::GDAL::Band::ColorInterpretations | ( | ) |
Package subroutine.
public Geo::GDAL::ColorTable Geo::GDAL::Band::ColorTable | ( | scalar | ColorTable | ) |
Object method. Get or set the color table of this band.
ColorTable | [optional] a Geo::GDAL::ColorTable object |
public method Geo::GDAL::Band::ComputeBandStats | ( | scalar | samplestep = 1 | ) |
Object method.
samplestep | the row increment in computing the statistics. |
See also Geo::GDAL::Band::ComputeStatistics.
public method Geo::GDAL::Band::ComputeRasterMinMax | ( | scalar | approx_ok = 0 | ) |
Object method.
public list Geo::GDAL::Band::ComputeStatistics | ( | scalar | approx_ok, |
scalar | progress = undef , |
||
scalar | progress_data = undef |
||
) |
Object method.
approx_ok | Whether it is allowed to compute the statistics based on overviews or similar. |
See also Geo::GDAL::Band::ComputeBandStats.
public Geo::OGR::Layer Geo::GDAL::Band::Contours | ( | scalar | DataSource, |
hashref | LayerConstructor, | ||
scalar | ContourInterval, | ||
scalar | ContourBase, | ||
arrayref | FixedLevels, | ||
scalar | NoDataValue, | ||
scalar | IDField, | ||
scalar | ElevField, | ||
coderef | Progress, | ||
scalar | ProgressData | ||
) |
Object method. Generate contours for this raster band. This method can also be used with named parameters.
An example:
DataSource | a Geo::OGR::DataSource object, default is a Memory data source |
LayerConstructor | data for Geo::OGR::DataSource::CreateLayer, default is {Name => 'contours'} |
ContourInterval | default is 100 |
ContourBase | default is 0 |
FixedLevels | a reference to a list of fixed contour levels, default is [] |
NoDataValue | default is undef |
IDField | default is '', i.e., no field (the field is created if this is given) |
ElevField | default is '', i.e., no field (the field is created if this is given) |
progress | [optional] a reference to a subroutine, which will be called with parameters (number progress, string msg, progress_data) |
progress_data | [optional] |
public method Geo::GDAL::Band::CreateMaskBand | ( | array | flags | ) |
Object method.
flags | one or more mask flags. The flags are Geo::GDAL::Band::MaskFlags. |
public Geo::GDAL::Dataset Geo::GDAL::Band::Dataset | ( | ) |
Object method.
public scalar Geo::GDAL::Band::DataType | ( | ) |
public scalar Geo::GDAL::Band::DeleteNoDataValue | ( | ) |
Object method.
public Geo::GDAL::Band Geo::GDAL::Band::Distance | ( | hash | params | ) |
Object method. Compute distances to specific cells of this raster.
params | Named parameters:
|
public method Geo::GDAL::Band::Domains | ( | ) |
public method Geo::GDAL::Band::Fill | ( | scalar | real_part, |
scalar | imag_part = 0.0 |
||
) |
Object method. Fill the band with a constant value.
real_part | Real component of fill value. |
imag_part | Imaginary component of fill value. |
public method Geo::GDAL::Band::FillNoData | ( | scalar | mask, |
scalar | max_search_dist, | ||
scalar | smoothing_iterations, | ||
scalar | options, | ||
coderef | progress, | ||
scalar | progress_data | ||
) |
Object method. Interpolate values for cells in this raster. The cells to fill should be marked in the mask band with zero.
mask | [optional] a mask band indicating cells to be interpolated (zero valued) (default is to get it with Geo::GDAL::Band::GetMaskBand). |
max_search_dist | [optional] the maximum number of cells to search in all directions to find values to interpolate from (default is 10). |
smoothing_iterations | [optional] the number of 3x3 smoothing filter passes to run (0 or more) (default is 0). |
options | [optional] A reference to a hash. No options have been defined so far for this algorithm (default is {}). |
progress | [optional] a reference to a subroutine, which will be called with parameters (number progress, string msg, progress_data) (default is undef). |
progress_data | [optional] (default is undef). |
Documentation for GDAL algorithms
public method Geo::GDAL::Band::FlushCache | ( | ) |
Object method. Write cached data to disk. There is usually no need to call this method.
public scalar Geo::GDAL::Band::GetBandNumber | ( | ) |
Object method.
public list Geo::GDAL::Band::GetBlockSize | ( | ) |
Object method.
public list Geo::GDAL::Band::GetDefaultHistogram | ( | scalar | force = 1 , |
coderef | progress = undef , |
||
scalar | progress_data = undef |
||
) |
Object method.
force | true to force the computation |
progress | [optional] a reference to a subroutine, which will be called with parameters (number progress, string msg, progress_data) |
progress_data | [optional] |
public list Geo::GDAL::Band::GetHistogram | ( | hash | parameters | ) |
Object method. Compute histogram from the raster.
parameters | Named parameters:
|
public Geo::GDAL::Band Geo::GDAL::Band::GetMaskBand | ( | ) |
Object method.
public list Geo::GDAL::Band::GetMaskFlags | ( | ) |
Object method.
public scalar Geo::GDAL::Band::GetMaximum | ( | ) |
Object method.
public scalar Geo::GDAL::Band::GetMinimum | ( | ) |
Object method.
public Geo::GDAL::Band Geo::GDAL::Band::GetOverview | ( | scalar | index | ) |
Object method.
index | 0..GetOverviewCount-1 |
public scalar Geo::GDAL::Band::GetOverviewCount | ( | ) |
Object method.
public list Geo::GDAL::Band::GetStatistics | ( | scalar | approx_ok, |
scalar | force | ||
) |
Object method.
approx_ok | Whether it is allowed to compute the statistics based on overviews or similar. |
force | Whether to force scanning of the whole raster. |
public method Geo::GDAL::Band::HasArbitraryOverviews | ( | ) |
Object method.
public list Geo::GDAL::Band::MaskFlags | ( | ) |
Package subroutine.
public scalar Geo::GDAL::Band::NoDataValue | ( | scalar | NoDataValue | ) |
Object method. Remove no data value from this band.
NoDataValue | [optional] Get or set the "no data" value. |
public scalar Geo::GDAL::Band::PackCharacter | ( | ) |
Object method.
public method Geo::GDAL::Band::Piddle | ( | ) |
public Geo::OGR::Layer Geo::GDAL::Band::Polygonize | ( | hash | params | ) |
Object method. Polygonize this raster band.
params | Named parameters:
|
public method Geo::GDAL::Band::RasterAttributeTable | ( | ) |
public scalar Geo::GDAL::Band::ReadRaster | ( | hash | params | ) |
Object method. Read data from the band.
params | Named parameters:
|
Entry in GDAL docs (method RasterIO)
public array reference Geo::GDAL::Band::ReadTile | ( | scalar | xoff = 0 , |
scalar | yoff = 0 , |
||
scalar | xsize = <width> , |
||
scalar | ysize = <height> |
||
) |
Object method.
Usage example (print the data from a band):
Another usage example (process the data of a large dataset that has one band):
xoff | Number of cell to skip before starting to read from a row. Pixels are read from left to right. |
yoff | Number of cells to skip before starting to read from a column. Pixels are read from top to bottom. |
xsize | Number of cells to read from each row. |
ysize | Number of cells to read from each column. |
public method Geo::GDAL::Band::RegenerateOverview | ( | Geo::GDAL::Band | overview, |
scalar | resampling, | ||
coderef | progress, | ||
scalar | progress_data | ||
) |
Object method.
overview | a Geo::GDAL::Band object for the overview. |
resampling | [optional] the resampling method (one of Geo::GDAL::RIOResamplingTypes) (default is Average). |
progress | [optional] a reference to a subroutine, which will be called with parameters (number progress, string msg, progress_data) |
progress_data | [optional] |
public method Geo::GDAL::Band::RegenerateOverviews | ( | arrayref | overviews, |
scalar | resampling, | ||
coderef | progress, | ||
scalar | progress_data | ||
) |
Object method.
overviews | a list of Geo::GDAL::Band objects for the overviews. |
resampling | [optional] the resampling method (one of Geo::GDAL::RIOResamplingTypes) (default is Average). |
progress | [optional] a reference to a subroutine, which will be called with parameters (number progress, string msg, progress_data) |
progress_data | [optional] |
public method Geo::GDAL::Band::ScaleAndOffset | ( | scalar | scale, |
scalar | offset | ||
) |
Object method. Scale and offset are used to transform raw cell values into the units returned by GetUnits(). The conversion function is:
public list Geo::GDAL::Band::SetDefaultHistogram | ( | scalar | min, |
scalar | max, | ||
scalar | histogram | ||
) |
Object method.
min | |
max |
histogram | reference to an array containing the histogram |
public method Geo::GDAL::Band::SetStatistics | ( | scalar | min, |
scalar | max, | ||
scalar | mean, | ||
scalar | stddev | ||
) |
Object method. Save the statistics of the band if possible (the format can save arbitrary metadata).
min | |
max | |
mean | |
stddev |
Code:
click to view
|
public Geo::GDAL::Band Geo::GDAL::Band::Sieve | ( | hash | params | ) |
Object method. Remove small areas by merging them into the largest neighbour area.
params | Named parameters:
|
public list Geo::GDAL::Band::Size | ( | ) |
Object method.
public method Geo::GDAL::Band::Unit | ( | scalar | type | ) |
Object method.
type | [optional] the unit (a string). |
public method Geo::GDAL::Band::WriteRaster | ( | hash | params | ) |
Object method. Write data into the band.
params | Named parameters:
|
Entry in GDAL docs (method RasterIO)
public method Geo::GDAL::Band::WriteTile | ( | scalar | data, |
scalar | xoff = 0 , |
||
scalar | yoff = 0 |
||
) |
Object method.
data | A two-dimensional Perl array, organizes as data->[y][x], y = 0..height-1, x = 0..width-1. |
xoff | |
yoff |