GdalRasterBand Class Reference

Represents a single band of raster datasource. Please refer to GDAL documentation for more details information. More...

Collaboration diagram for GdalRasterBand:
Collaboration graph

Public Member Functions

GridColorScheme Classify (double MinValue, double MaxValue, tkClassificationType classification, int NumCategories)
 Builds classification for the raster band. More...
 
bool ComputeLocalStatistics (int Column, int Row, int range, out double Minimum, out double Maximum, out double mean, out double stdDev, out int Count)
 Computes local statistics for the data in the vicinity of particular pixel. More...
 
bool ComputeMinMax (bool allowApproximate, out double Minimum, out double Maximum)
 Computes the minimum and maximum value for the raster band. More...
 
string get_MetadataItem (int itemIndex)
 Gets the specified metadata item. More...
 
GdalRasterBand get_Overview (int overviewIndex)
 Gets specified overview of the raster band. More...
 
bool get_Value (int Column, int Row, out double pVal)
 Gets the value of the specified pixel. More...
 
Histogram GetDefaultHistogram (bool forceCalculate)
 Gets the default histogram. More...
 
Histogram GetHistogram (double MinValue, double MaxValue, int NumBuckets, bool includeOutOfRange, bool allowApproximate)
 Gets custom histogram for the raster band. More...
 
bool GetStatistics (bool allowApproximate, bool forceCalculation, out double Minimum, out double Maximum, out double mean, out double stdDev)
 Gets statistics for the raster band. More...
 
bool GetUniqueValues (int maxCount, out object arr)
 Gets unique values of the band. More...
 

Properties

int BlockSizeX [get]
 Gets the size of horizontal block for the raster (in pixels). More...
 
int BlockSizeY [get]
 Gets the size of vertical block for the raster (in pixels). More...
 
tkColorInterpretation ColorInterpretation [get, set]
 Gets or sets the color interpretation for the raster band. More...
 
GridColorScheme ColorTable [get]
 Gets the color table associated with the band. More...
 
tkGdalDataType DataType [get]
 Gets the data type of the raster band. More...
 
bool HasColorTable [get]
 Gets a value indicating whether the raster band has color table. More...
 
double Maximum [get]
 Gets the maximum. More...
 
int MetadataCount [get]
 Gets the number of metadata items associated with the band. More...
 
double Minimum [get]
 Gets the minimum. More...
 
double NodataValue [get]
 Gets no data value. More...
 
double Offset [get]
 Gets the raster value offset (is used for coordinate transformation). More...
 
int OverviewCount [get]
 Gets the number of overviews for the raster band. More...
 
double Scale [get]
 Gets the raster value scale (is used for coordinate transformation). More...
 
string UnitType [get]
 Gets the type of the unit. More...
 
int XSize [get]
 Gets the width of the raster band in pixels. More...
 
int YSize [get]
 Gets the height of the raster band in pixels. More...
 

Detailed Description

Represents a single band of raster datasource. Please refer to GDAL documentation for more details information.

New API 4.9.4:
Added in version 4.9.4

Member Function Documentation

◆ Classify()

GridColorScheme GdalRasterBand.Classify ( double  MinValue,
double  MaxValue,
tkClassificationType  classification,
int  NumCategories 
)

Builds classification for the raster band.

Parameters
MinValueThe minimum value.
MaxValueThe maximum value.
classificationThe classification type.
NumCategoriesThe number of categories.
Returns
Resulting classification.

◆ ComputeLocalStatistics()

bool GdalRasterBand.ComputeLocalStatistics ( int  Column,
int  Row,
int  range,
out double  Minimum,
out double  Maximum,
out double  mean,
out double  stdDev,
out int  Count 
)

Computes local statistics for the data in the vicinity of particular pixel.

Parameters
ColumnThe column.
RowThe row.
rangeNumber of pixel on each side to be included in calculation.
MinimumThe minimum value.
MaximumThe maximum value.
meanThe mean.
stdDevThe standard deviation.
CountThe count.
Returns
True on success.

◆ ComputeMinMax()

bool GdalRasterBand.ComputeMinMax ( bool  allowApproximate,
out double  Minimum,
out double  Maximum 
)

Computes the minimum and maximum value for the raster band.

Parameters
allowApproximateIf set to true the approximate calculation will be allowed.
MinimumThe minimum value.
MaximumThe maximum value.
Returns
True on success.

◆ get_MetadataItem()

string GdalRasterBand.get_MetadataItem ( int  itemIndex)

Gets the specified metadata item.

Parameters
itemIndexIndex of the item.
Returns
String with metadata.

◆ get_Overview()

GdalRasterBand GdalRasterBand.get_Overview ( int  overviewIndex)

Gets specified overview of the raster band.

Parameters
overviewIndexIndex of the overview.
Returns
The overview as another instance of GdalRasterBand.

◆ get_Value()

bool GdalRasterBand.get_Value ( int  Column,
int  Row,
out double  pVal 
)

Gets the value of the specified pixel.

Parameters
ColumnThe column.
RowThe row.
pValThe value.
Returns
True on success.

◆ GetDefaultHistogram()

Histogram GdalRasterBand.GetDefaultHistogram ( bool  forceCalculate)

Gets the default histogram.

Parameters
forceCalculateIf set to true and there is no dialog available, it will be calculated.
Returns
The histogram.

◆ GetHistogram()

Histogram GdalRasterBand.GetHistogram ( double  MinValue,
double  MaxValue,
int  NumBuckets,
bool  includeOutOfRange,
bool  allowApproximate 
)

Gets custom histogram for the raster band.

Parameters
MinValueThe minimum value.
MaxValueThe maximum value.
NumBucketsThe number buckets.
includeOutOfRangeIf set to true the values outside the specified range will be included in outer buckets.
allowApproximateIf set to true the approximate calculation will be allowed.
Returns
Exceptions
System.NotImplementedException

◆ GetStatistics()

bool GdalRasterBand.GetStatistics ( bool  allowApproximate,
bool  forceCalculation,
out double  Minimum,
out double  Maximum,
out double  mean,
out double  stdDev 
)

Gets statistics for the raster band.

Parameters
allowApproximateIf set to true the approximate calculation will be allowed.
forceCalculationif set to true the calculation will be performed even if there are no cached values.
MinimumThe minimum value.
MaximumThe maximum value.
meanThe mean.
stdDevThe standard deviation.
Returns
True on success.

◆ GetUniqueValues()

bool GdalRasterBand.GetUniqueValues ( int  maxCount,
out object  arr 
)

Gets unique values of the band.

Parameters
maxCountThe maximum count of values to be returned.
arrThe array with values.
Returns
True on success.

Property Documentation

◆ BlockSizeX

int GdalRasterBand.BlockSizeX
get

Gets the size of horizontal block for the raster (in pixels).

◆ BlockSizeY

int GdalRasterBand.BlockSizeY
get

Gets the size of vertical block for the raster (in pixels).

◆ ColorInterpretation

tkColorInterpretation GdalRasterBand.ColorInterpretation
getset

Gets or sets the color interpretation for the raster band.

◆ ColorTable

GridColorScheme GdalRasterBand.ColorTable
get

Gets the color table associated with the band.

◆ DataType

tkGdalDataType GdalRasterBand.DataType
get

Gets the data type of the raster band.

◆ HasColorTable

bool GdalRasterBand.HasColorTable
get

Gets a value indicating whether the raster band has color table.

◆ Maximum

double GdalRasterBand.Maximum
get

Gets the maximum.

◆ MetadataCount

int GdalRasterBand.MetadataCount
get

Gets the number of metadata items associated with the band.

◆ Minimum

double GdalRasterBand.Minimum
get

Gets the minimum.

◆ NodataValue

double GdalRasterBand.NodataValue
get

Gets no data value.

◆ Offset

double GdalRasterBand.Offset
get

Gets the raster value offset (is used for coordinate transformation).

◆ OverviewCount

int GdalRasterBand.OverviewCount
get

Gets the number of overviews for the raster band.

◆ Scale

double GdalRasterBand.Scale
get

Gets the raster value scale (is used for coordinate transformation).

◆ UnitType

string GdalRasterBand.UnitType
get

Gets the type of the unit.

◆ XSize

int GdalRasterBand.XSize
get

Gets the width of the raster band in pixels.

◆ YSize

int GdalRasterBand.YSize
get

Gets the height of the raster band in pixels.