Geo::GDAL
2.2
|
A raster band.
More...
Public Member Functions | |
public Geo::GDAL::RasterAttributeTable | AttributeTable (scalar AttributeTable) |
public list | BlockSize () |
public list | CategoryNames (array names) |
public scalar | Checksum (scalar xoff=0, scalar yoff=0, scalar xsize=undef, scalar ysize=undef) |
public hashref | ClassCounts (scalar classifier, scalar progress=undef, scalar progress_data=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 method | 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 (scalar piddle, scalar xoff=0, scalar yoff=0, scalar xsize=< width >, scalar ysize=< height >, scalar xdim, scalar ydim) |
public Geo::OGR::Layer | Polygonize (hash params) |
public method | RELEASE_PARENT () |
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 | Reclassify (scalar classifier, scalar progress=undef, scalar progress_data=undef) |
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 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 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 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 method | IdentifyDriverEx () |
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 method | RELEASE_PARENT () |
public list | RIOResamplingTypes () |
public list | ResamplingTypes () |
public method | SetCacheMax (scalar Bytes) |
public method | SetConfigOption (scalar key, scalar value) |
public method | UseExceptions () |
public method | VSICurlClearCache () |
public method | VSIFOpenExL () |
public method | VSIGetLastErrorMsg () |
public method | VSIGetLastErrorNo () |
public scalar | VersionInfo (scalar request='VERSION_NUM') |
public scalar | errstr () |
public method | i2s () |
public method | keep () |
public method | note () |
public method | parent () |
public method | s2i () |
public method | s_exists () |
public method | unkeep () |
public method | unnote () |
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::BlockSize | ( | ) |
Object method.
A.k.a GetBlockSize
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 hashref Geo::GDAL::Band::ClassCounts | ( | scalar | classifier, |
scalar | progress = undef , |
||
scalar | progress_data = undef |
||
) |
Object method.
Compute the counts of cell values or number of cell values in ranges.
classifier | Anonymous array of format [ $comparison, $classifier ], where $comparison is a string '<', '<=', '>', or '>=' and $classifier is an anonymous array of format [ $value, $value|$classifier, $value|$classifier ], where $value is numeric value against which the reclassified value is compared to. |
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. |
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. |
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.
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: - Distance A raster band, into which the distances are computed. If not given, a not given, a new in-memory raster band is created and returned. The data type of the raster can be given in the options. - Options Hash of options. Options are: - Values A list of cell values in this band to measure the distance from. If this option is not provided, the distance will be computed to non-zero pixel values. Currently pixel values are internally processed as integers. - DistUnits=PIXEL|GEO Indicates whether distances will be computed in cells or in georeferenced units. The default is pixel units. This also determines the interpretation of MaxDist. - MaxDist=n The maximum distance to search. Distances greater than this value will not be computed. Instead output cells will be set to a NoData value. - NoData=n The NoData value to use on the distance band for cells that are beyond MaxDist. If not provided, the distance band will be queried for a NoData value. If one is not found, 65535 will be used (255 if the type is Byte). - Use_Input_NoData=YES|NO If this option is set, the NoData value of this band will be respected. Leaving NoData cells in the input as NoData pixels in the distance raster. - Fixed_Buf_Val=n If this option is set, all cells within the MaxDist threshold are set to this value instead of the distance value. - DataType The data type for the result if it is not given. - Progress Progress function. - ProgressData Additional parameter for the progress function. |
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 method Geo::GDAL::Band::GetBlockSize | ( | ) |
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: - Min the lower bound, default is -0.5 - Max the upper bound, default is 255.5 - Buckets the number of buckets in the histogram, default is 256 - IncludeOutOfRange whether to use the first and last values in the returned list for out of range values, default is false; the bucket size is (Max-Min) / Buckets if this is false and (Max-Min) / (Buckets-2) if this is true - ApproxOK if histogram can be computed from overviews, default is false - Progress an optional progress function, the default is undef - ProgressData data for the progress function, the default is undef |
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.
Get or set the "no data" value.
NoDataValue | [optional] |
public scalar Geo::GDAL::Band::PackCharacter | ( | ) |
Object method.
public method Geo::GDAL::Band::Piddle | ( | scalar | piddle, |
scalar | xoff = 0 , |
||
scalar | yoff = 0 , |
||
scalar | xsize = <width> , |
||
scalar | ysize = <height> , |
||
scalar | xdim, | ||
scalar | ydim | ||
) |
Object method.
Read or write band data from/into a piddle.
piddle | [only when writing] The piddle from which to read the data to be written into the band. |
xoff,yoff | The offset for data in the band, default is top left (0, 0). |
xsize,ysize | [optional] The size of the window in the band. |
xdim,ydim | [optional, only when reading from a band] The size of the piddle to create. |
public Geo::OGR::Layer Geo::GDAL::Band::Polygonize | ( | hash | params | ) |
Object method.
Polygonize this raster band.
params | Named parameters: - Mask A raster band, which is used as a mask to select polygonized areas. Default is undef. - OutLayer A vector layer into which the polygons are written. If not given, an in-memory layer 'polygonized' is created and returned. - PixValField The name of the field in the output layer into which the cell value of the polygon area is stored. Default is 'val'. - Options Hash or list of options. Connectedness can be set to 8 to use 8-connectedness, otherwise 4-connectedness is used. ForceIntPixel can be set to 1 to force using a 32 bit int buffer for cell values in the process. If this is not set and the data type of this raster does not fit into a 32 bit int buffer, a 32 bit float buffer is used. - Progress Progress function. - ProgressData Additional parameter for the progress function. |
public method Geo::GDAL::Band::RasterAttributeTable | ( | ) |
public scalar Geo::GDAL::Band::ReadRaster | ( | hash | params | ) |
Object method.
Read data from the band.
params | Named 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 band) - YSize height of the area to read (default is the height of the band) - 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 band) - BufPixelSpace (default is 0) - BufLineSpace (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) |
public array reference Geo::GDAL::Band::ReadTile | ( | scalar | xoff = 0 , |
scalar | yoff = 0 , |
||
scalar | xsize = <width> , |
||
scalar | ysize = <height> |
||
) |
Object method.
Read band data into a Perl array.
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::Reclassify | ( | scalar | classifier, |
scalar | progress = undef , |
||
scalar | progress_data = undef |
||
) |
Object method.
Reclassify the cells in the band.
classifier | For integer rasters an anonymous hash, which contains old class values as keys and new class values as values. A special key '*' (star) can be used as default, to act as a fallback new class value. For float rasters as in Geo::GDAL::Band::ClassCounts. |
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::RELEASE_PARENT | ( | ) |
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 |
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: - Mask A raster band, which is used as a mask to select sieved areas. Default is undef. - Dest A raster band into which the result is written. If not given, an new in-memory raster band is created and returned. - Threshold The smallest area size (in number of cells) which are not sieved away. - Options Hash or list of options. {Connectedness => 4} can be specified to use 4-connectedness, otherwise 8-connectedness is used. - Progress Progress function. - ProgressData Additional parameter for the progress function. |
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: - 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 band) - YSize height of the area to write (default is the height of the band) - 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 band) - BufPixelSpace (default is 0) - BufLineSpace (default is 0) Entry in GDAL docs (method RasterIO) |
public method Geo::GDAL::Band::WriteTile | ( | scalar | data, |
scalar | xoff = 0 , |
||
scalar | yoff = 0 |
||
) |
Object method.
Write band data from a Perl array.
data | A two-dimensional Perl array, organizes as data->[y][x], y = 0..height-1, x = 0..width-1. |
xoff | |
yoff |