Geo::GDAL
2.0
|
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, subref Progress, scalar ProgressData) |
public method | CreateMaskBand (array flags) |
public scalar | DataType () |
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, subref progress, scalar progress_data) |
public method | FlushCache () |
public scalar | GetBandNumber () |
public list | GetBlockSize () |
public Geo::GDAL::ColorTable | GetColorTable () |
public method | GetDataset () |
public list | GetDefaultHistogram (scalar force=1, subref 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 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, subref progress, scalar progress_data) |
public method | RegenerateOverviews (arrayref overviews, scalar resampling, subref progress, scalar progress_data) |
public method | ScaleAndOffset (scalar scale, scalar offset) |
public method | SetColorTable (scalar ColorTable) |
public list | SetDefaultHistogram (scalar min, scalar max, scalar histogram) |
public method | SetStatistics (scalar min, scalar max, scalar mean, scalar stddev) |
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 list | AccessTypes () |
public Geo::GDAL::Dataset | AutoCreateWarpedVRT (Geo::GDAL::Dataset src, Geo::OSR::SpatialReference src_srs=undef, Geo::OSR::SpatialReference dst_srs=undef, scalar ResampleAlg='NearestNeighbour', scalar maxerror=0.0) |
public method | CPLBinaryToHex () |
public method | CPLHexToBinary () |
public list | Child (scalar node, scalar i) |
public list | Children (scalar node) |
public method | ComputeMedianCutPCT (Geo::GDAL::Band red, Geo::GDAL::Band green, Geo::GDAL::Band blue, scalar num_colors, scalar colors, subref progress, scalar progress_data) |
public method | ComputeProximity (Geo::GDAL::Band src, Geo::GDAL::Band proximity, hashref options, subref progress, scalar progress_data) |
public scalar | DataTypeIsComplex (scalar DataType) |
public list | DataTypeValueRange (scalar DataType) |
public list | DataTypes () |
public method | Debug () |
public scalar | DecToDMS (scalar angle, scalar axis, scalar precision=2) |
public scalar | DecToPackedDMS (scalar dec) |
public method | DitherRGB2PCT (scalar red, scalar green, scalar blue, scalar target, scalar colors, subref progress, scalar progress_data) |
public method | EscapeString () |
public scalar | FindFile (scalar class, 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, scalar default) |
public scalar | GetDataTypeSize (scalar DataType) |
public Geo::GDAL::Driver | GetDriver (scalar name) |
public list | GetDriverNames () |
public method | GetJPEG2000StructureAsString () |
public Geo::GDAL::Driver | IdentifyDriver (scalar path, scalar siblings) |
public list | NodeData (scalar node) |
public scalar | NodeType (scalar type) |
public list | NodeTypes () |
public Geo::GDAL::Dataset | Open (scalar name, scalar access= 'ReadOnly') |
public Geo::GDAL::Dataset | OpenEx (scalar name, scalar open_flags=0, array reference allowed_drivers=undef, array reference open_options=undef, array reference sibling_files=undef) |
public Geo::GDAL::Dataset | OpenShared (scalar name, scalar access= 'ReadOnly') |
public scalar | PackCharacter (scalar DataType) |
public scalar | PackedDMSToDec (scalar packed) |
public array reference | ParseXMLString (scalar XML) |
public method | Polygonize (Geo::GDAL::Band src, Geo::GDAL::Band mask, Geo::OGR::Layer out, scalar PixValField, hashref options, subref progress, scalar progress_data) |
public method | PopFinderLocation () |
public method | PushFinderLocation (scalar path) |
public list | RIOResamplingTypes () |
public method | RasterizeLayer (Geo::GDAL::Dataset ds, arrayref bands, Geo::OGR::Layer layer, scalar transformer, scalar arg, arrayref burn_values, hashref options, subref progress, scalar progress_data) |
public method | ReprojectImage (scalar src_ds, scalar dst_ds, scalar src_wkt=undef, scalar dst_wkt=undef, scalar ResampleAlg='NearestNeighbour', scalar WarpMemoryLimit=0, scalar maxerror=0.0, subref progress, scalar progress_data) |
public list | ResamplingTypes () |
public scalar | SerializeXMLTree (arrayref XMLTree) |
public method | SetCacheMax (scalar Bytes) |
public method | SetConfigOption (scalar key, scalar value) |
public method | SieveFilter (Geo::GDAL::Band src, Geo::GDAL::Band mask, Geo::GDAL::Band dst, scalar threshold, scalar connectedness, hashref options, subref progress, scalar progress_data) |
public scalar | VersionInfo (scalar request= 'VERSION_NUM') |
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 | ) |
AttributeTable | [optional] A Geo::GDAL::RasterAttributeTable object. |
public list Geo::GDAL::Band::CategoryNames | ( | array | names | ) |
names | [optional] |
public scalar Geo::GDAL::Band::Checksum | ( | scalar | xoff = 0 , |
scalar | yoff = 0 , |
||
scalar | xsize = undef , |
||
scalar | ysize = undef |
||
) |
Computes a checksum from the raster or a part of it.
xoff | |
yoff | |
xsize | |
ysize |
public scalar Geo::GDAL::Band::ColorInterpretation | ( | scalar | color_interpretation | ) |
color_interpretation | [optional] new color interpretation, one of Geo::GDAL::Band::ColorInterpretations. |
public method Geo::GDAL::Band::ColorInterpretations | ( | ) |
public Geo::GDAL::ColorTable Geo::GDAL::Band::ColorTable | ( | scalar | ColorTable | ) |
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 | ) |
samplestep | the row increment in computing the statistics. |
See also Geo::GDAL::Band::ComputeStatistics.
public method Geo::GDAL::Band::ComputeRasterMinMax | ( | scalar | approx_ok = 0 | ) |
public list Geo::GDAL::Band::ComputeStatistics | ( | scalar | approx_ok, |
scalar | progress = undef , |
||
scalar | progress_data = undef |
||
) |
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, | ||
subref | Progress, | ||
scalar | ProgressData | ||
) |
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 | ) |
flags | one or more mask flags. The flags are Geo::GDAL::Band::MaskFlags. |
public scalar Geo::GDAL::Band::DataType | ( | ) |
public method Geo::GDAL::Band::Domains | ( | ) |
public method Geo::GDAL::Band::Fill | ( | scalar | real_part, |
scalar | imag_part = 0.0 |
||
) |
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, | ||
subref | progress, | ||
scalar | progress_data | ||
) |
Interpolate values for pixels in this raster. The pixels to fill should be marked in the mask band with zero.
mask | [optional] a mask band indicating pixels to be interpolated (zero valued) (default is to get it with Geo::GDAL::Band::GetMaskBand). |
max_search_dist | [optional] the maximum number of pixels 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 | ( | ) |
Write cached data to disk. There is usually no need to call this method.
public scalar Geo::GDAL::Band::GetBandNumber | ( | ) |
public list Geo::GDAL::Band::GetBlockSize | ( | ) |
public Geo::GDAL::ColorTable Geo::GDAL::Band::GetColorTable | ( | ) |
public method Geo::GDAL::Band::GetDataset | ( | ) |
public list Geo::GDAL::Band::GetDefaultHistogram | ( | scalar | force = 1 , |
subref | progress = undef , |
||
scalar | progress_data = undef |
||
) |
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 | ) |
Compute histogram from the raster.
parameters | Named parameters:
|
public Geo::GDAL::Band Geo::GDAL::Band::GetMaskBand | ( | ) |
public list Geo::GDAL::Band::GetMaskFlags | ( | ) |
public scalar Geo::GDAL::Band::GetMaximum | ( | ) |
public scalar Geo::GDAL::Band::GetMinimum | ( | ) |
public Geo::GDAL::Band Geo::GDAL::Band::GetOverview | ( | scalar | index | ) |
index | 0..GetOverviewCount-1 |
public scalar Geo::GDAL::Band::GetOverviewCount | ( | ) |
public list Geo::GDAL::Band::GetStatistics | ( | scalar | approx_ok, |
scalar | force | ||
) |
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 | ( | ) |
public list Geo::GDAL::Band::MaskFlags | ( | ) |
Class method.
public scalar Geo::GDAL::Band::NoDataValue | ( | scalar | NoDataValue | ) |
NoDataValue | [optional] Get or set the "no data" value. |
public scalar Geo::GDAL::Band::PackCharacter | ( | ) |
public scalar Geo::GDAL::Band::ReadRaster | ( | hash | params | ) |
Read data from the band.
params | named parameters. These are
|
If the parameters are given as a list the order is as above. 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> |
||
) |
Usage example (print the data from a band):
Another usage example (process the data of a large dataset that has one band):
xoff | |
yoff | |
xsize | |
ysize |
public method Geo::GDAL::Band::RegenerateOverview | ( | Geo::GDAL::Band | overview, |
scalar | resampling, | ||
subref | progress, | ||
scalar | progress_data | ||
) |
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, | ||
subref | progress, | ||
scalar | progress_data | ||
) |
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 | ||
) |
Scale and offset are used to transform raw pixel values into the units returned by GetUnits(). The conversion function is:
public method Geo::GDAL::Band::SetColorTable | ( | scalar | ColorTable | ) |
ColorTable | A color table object. |
public list Geo::GDAL::Band::SetDefaultHistogram | ( | scalar | min, |
scalar | max, | ||
scalar | histogram | ||
) |
min | |
max | |
histogram | reference to an array containing the histogram |
public method Geo::GDAL::Band::SetStatistics | ( | scalar | min, |
scalar | max, | ||
scalar | mean, | ||
scalar | stddev | ||
) |
Save the statistics of the band if possible (the format can save arbitrary metadata).
min | |
max | |
mean | |
stddev |
Code:
click to view
|
public list Geo::GDAL::Band::Size | ( | ) |
public method Geo::GDAL::Band::Unit | ( | scalar | type | ) |
type | [optional] the unit (a string). |
public method Geo::GDAL::Band::WriteRaster | ( | hash | params | ) |
Write data into the band.
params | named parameters. These are
|
If the parameters are given as a list the order is as above. Entry in GDAL docs (method RasterIO)
public method Geo::GDAL::Band::WriteTile | ( | scalar | data, |
scalar | xoff = 0 , |
||
scalar | yoff = 0 |
||
) |
data | A two-dimensional Perl array, organizes as data->[y][x], y = 0..height-1, x = 0..width-1. |
xoff | |
yoff |