Show:

A single raster band (or channel).

Methods

computeStatistics
(
  • allow_approximation
)
Object

Computes image statistics.

Returns the minimum, maximum, mean and standard deviation of all pixel values in this band. If approximate statistics are sufficient, the allow_approximation argument can be set to true in which case overviews, or a subset of image tiles may be used in computing the statistics.

Parameters:

  • allow_approximation Boolean

    If true statistics may be computed based on overviews or a subset of all tiles.

Returns:

Object:

Statistics containing "min", "max", "mean", "std_dev" properties.

createMaskBand
(
  • flags
)

Adds a mask band to the current band.

Parameters:

  • flags Integer

    Mask flags

fill
(
  • real_value
  • imaginary_value
)

Fill this band with a constant value.

Parameters:

  • real_value Number
  • [imaginary_value] Number optional
flush ()

Saves changes to disk.

getMaskBand () gdal.RasterBand

Return the mask band associated with the band.

Returns:

getMaskFlags () Integer

Return the status flags of the mask band associated with the band.

The result will be a bitwise OR-ed set of status flags with the following available definitions that may be extended in the future:

  • GMF_ALL_VALID (0x01): There are no invalid pixels, all mask values will be 255. When used this will normally be the only flag set.
  • GMF_PER_DATASET (0x02): The mask band is shared between all bands on the dataset.
  • GMF_ALPHA (0x04): The mask band is actually an alpha band and may have values other than 0 and 255.
  • GMF_NODATA (0x08): Indicates the mask is actually being generated from nodata values. (mutually exclusive of GMF_ALPHA)

Returns:

Integer:

Mask flags

getMetadata
(
  • domain
)

Returns band metadata

Parameters:

  • [domain] String optional
getStatistics
(
  • allow_approximation
  • force
)
Object

Fetch image statistics.

Returns the minimum, maximum, mean and standard deviation of all pixel values in this band. If approximate statistics are sufficient, the allow_approximation argument can be set to true in which case overviews, or a subset of image tiles may be used in computing the statistics.

Parameters:

  • allow_approximation Boolean

    If true statistics may be computed based on overviews or a subset of all tiles.

  • force Boolean

    If false statistics will only be returned if it can be done without rescanning the image.

Returns:

Object:

Statistics containing "min", "max", "mean", "std_dev" properties.

setStatistics
(
  • min
  • max
  • mean
  • std_dev
)

Set statistics on the band. This method can be used to store min/max/mean/standard deviation statistics.

Parameters:

  • min Number
  • max Number
  • mean Number
  • std_dev Number

Attributes

blockSize

Object readonly

Size object containing "x" and "y" properties.

categoryNames

Array

List of list of category names for this raster.

colorInterpretation

String

Color interpretation mode (see GCI constants).

dataType

String | Undefined readonly

Pixel data type (see GDT constants) used for this band.

description

String readonly

Name of of band.

ds

gdal.Dataset readonly

hasArbitraryOverviews

Boolean readonly

An indicator if the underlying datastore can compute arbitrary overviews efficiently, such as is the case with OGDI over a network. Datastores with arbitrary overviews don't generally have any fixed overviews, but GDAL's RasterIO() method can be used in downsampling mode to get overview data efficiently.

id

Integer | Null readonly

maximum

Number readonly

Maximum value for this band.

minimum

Number readonly

Minimum value for this band.

noDataValue

Number | Null

No data value for this band.

offset

Number

Raster value offset.

readOnly

Boolean readonly

Indicates if the band is read-only.

scale

Number

Raster value scale.

size

Object readonly

Size object containing "x" and "y" properties.

unitType

String

Raster unit type (name for the units of this raster's values). For instance, it might be "m" for an elevation model in meters, or "ft" for feet. If no units are available, a value of "" will be returned.