Geo::GDAL 1.6.0

Geo::GDAL::Band Class Reference

Inheritance diagram for Geo::GDAL::Band:
Inheritance graph
[legend]

List of all members.

Public Object Methods

scalar DataType ()
list GetBlockSize ()
 ColorInterpretation (scalar color_interpretation)
scalar NoDataValue (scalar NoDataValue)
scalar GetNoDataValue ()
 SetNoDataValue (scalar NoDataValue)
scalar GetMinimum ()
scalar GetMaximum ()
scalar GetOffset ()
scalar GetScale ()
list GetStatistics (scalar approx_ok, scalar force)
 SetStatistics (scalar min, scalar max, scalar mean, scalar stddev)
scalar GetOverviewCount ()
Geo::GDAL::Band GetOverview (scalar band)
scalar Checksum (scalar xoff=0, scalar yoff=0, scalar xsize=undef, scalar ysize=undef)
 ComputeRasterMinMax (scalar approx_ok=0)
 ComputeBandStats (scalar samplestep=1)
 Fill (scalar real_part, scalar imag_part=0.0)
 WriteTile (scalar data, scalar xoff=0, scalar yoff=0)
listref ReadTile (scalar xoff=0, scalar yoff=0, scalar xsize=< width >, scalar ysize=< height >)
 WriteRaster (scalar xoff, scalar yoff, scalar xsize, scalar ysize, scalar buf, scalar buf_xsize=undef, scalar buf_ysize=undef, scalar buf_type=undef)
scalar ReadRaster (scalar xoff, scalar yoff, scalar xsize, scalar ysize, scalar buf_xsize=undef, scalar buf_ysize=undef, scalar buf_type=undef)
list GetHistogram (hash parameters)
 FlushCache ()
Geo::GDAL::ColorTable ColorTable (scalar ColorTable)
Geo::GDAL::ColorTable GetRasterColorTable ()
 SetRasterColorTable (scalar ColorTable)
 CreateMaskBand ()
scalar GetMaskBand ()
scalar GetMaskFlags ()
list CategoryNames (list names)
scalar GetRasterCategoryNames ()
 SetRasterCategoryNames (scalar names)
Geo::GDAL::RasterAttributeTable AttributeTable (scalar AttributeTable)
Geo::GDAL::RasterAttributeTable GetDefaultRAT ()
 SetDefaultRAT (scalar AttributeTable)
Geo::OGR::Layer Contours (scalar DataSource, hashref LayerConstructor, scalar ContourInterval, scalar ContourBase, listref FixedLevels, scalar NoDataValue, scalar IDField, scalar ElevField, scalar callback, scalar callback_data)
scalar GetRasterColorInterpretation ()
 SetRasterColorInterpretation ()

Public Attributes

 XSize
 YSize

Member Function Documentation

Geo::GDAL::RasterAttributeTable Geo::GDAL::Band::AttributeTable ( scalar  AttributeTable)
Parameters:
AttributeTable[optional] A Geo::GDAL::RasterAttributeTable object.
Returns:
a new Geo::GDAL::RasterAttributeTable object, whose data is contained within the band.
list Geo::GDAL::Band::CategoryNames ( list  names)
Parameters:
names[optional]
Returns:
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.

Parameters:
xoff
yoff
xsize
ysize
Returns:
the checksum.
Geo::GDAL::Band::ColorInterpretation ( scalar  color_interpretation)

Color interpretation is currently one of Undefined GrayIndex PaletteIndex RedBand GreenBand BlueBand AlphaBand HueBand SaturationBand LightnessBand CyanBand MagentaBand YellowBand BlackBand

Parameters:
color_interpretation[optional] new color interpretation
Returns:
color interpretation

Get or set the color table of this band.

Parameters:
ColorTable[optional] a Geo::GDAL::ColorTable object
Returns:
a new Geo::GDAL::ColorTable object in a non-void context.
Geo::GDAL::Band::ComputeBandStats ( scalar  samplestep = 1)
Parameters:
samplestep
Returns:
arrayref Stats [mean, stddev]
Geo::GDAL::Band::ComputeRasterMinMax ( scalar  approx_ok = 0)
Returns:
arrayref MinMax = [min, max]
Geo::OGR::Layer Geo::GDAL::Band::Contours ( scalar  DataSource,
hashref  LayerConstructor,
scalar  ContourInterval,
scalar  ContourBase,
listref  FixedLevels,
scalar  NoDataValue,
scalar  IDField,
scalar  ElevField,
scalar  callback,
scalar  callback_data 
)

Generate contours for this raster band. This method can also be used with named parameters.

Parameters:
DataSourcea Geo::OGR::DataSource object, default is a Memory data source
LayerConstructordata for Geo::OGR::DataSource::CreateLayer, default is {Name => 'contours'}
ContourIntervaldefault is 100
ContourBasedefault is 0
FixedLevelsa reference to a list of fixed contour levels, default is []
NoDataValuedefault is undef
IDFielddefault is '', i.e., no field
ElevFielddefault is '', i.e., no field
callback[optional] a reference to a subroutine, which will be called with parameters (number progress, string msg, callback_data)
callback_data[optional]
Returns:
Geo::GDAL::Band::CreateMaskBand ( )
scalar Geo::GDAL::Band::DataType ( )
Returns:
a data type string (Byte, UInt16, Int16, UInt32, Int32, Float32, Float64, CInt16, CInt32, CFloat32, or CFloat64). # ()
the size of the band as a list (width, height).
Geo::GDAL::Band::Fill ( scalar  real_part,
scalar  imag_part = 0.0 
)

Fill the band with a constant value.

Parameters:
real_partReal component of fill value.
imag_partImaginary component of fill value.
Geo::GDAL::Band::FlushCache ( )

Write cached data to disk. There is usually no need to call this method.

list Geo::GDAL::Band::GetBlockSize ( )
Returns:
the size of a preferred i/o raster blocks as a list (width, height).
Geo::GDAL::RasterAttributeTable Geo::GDAL::Band::GetDefaultRAT ( )
Deprecated:
use Geo::GDAL::Band::AttributeTable, which makes sure the band is not destroyed before the attribute table.
Returns:
a new Geo::GDAL::RasterAttributeTable object, whose data is contained within the band.
list Geo::GDAL::Band::GetHistogram ( hash  parameters)

Compute histogram from the raster.

Parameters:
parametersNamed 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 $histogram[0] and $histogram[$#histogram] 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
Returns:
a list which contains the count of values in each bucket
scalar Geo::GDAL::Band::GetMaskBand ( )
scalar Geo::GDAL::Band::GetMaskFlags ( )
scalar Geo::GDAL::Band::GetMaximum ( )
Returns:
statistical minimum of the band or undef if statistics are not kept or computed.
scalar Geo::GDAL::Band::GetMinimum ( )
Returns:
statistical minimum of the band or undef if statistics are not kept or computed.
scalar Geo::GDAL::Band::GetNoDataValue ( )
Returns:
number (the "no data" value) or undef (there is no "no data" value).
scalar Geo::GDAL::Band::GetOffset ( )

Scale and offset used to store data values in transformed form. The conversion function is:

Units value = (raw value * scale) + offset
Returns:
offset or undef.
Geo::GDAL::Band Geo::GDAL::Band::GetOverview ( scalar  band)
Parameters:
band0..GetOverviewCount-1
Returns:
a new Geo::GDAL::Band object.
scalar Geo::GDAL::Band::GetOverviewCount ( )
Returns:
the number of overviews available of the band.
scalar Geo::GDAL::Band::GetRasterCategoryNames ( )
Returns:
scalar Geo::GDAL::Band::GetRasterColorInterpretation ( )
Deprecated:
use Geo::GDAL::Band::ColorInterpretation, which understands strings
Geo::GDAL::ColorTable Geo::GDAL::Band::GetRasterColorTable ( )
Returns:
a color table object.
scalar Geo::GDAL::Band::GetScale ( )

Scale and offset are used to store data values in transformed form. The conversion function is:

Units value = (raw value * scale) + offset
Returns:
scale or undef.
list Geo::GDAL::Band::GetStatistics ( scalar  approx_ok,
scalar  force 
)
Parameters:
approx_okWhether it is allowed to compute the statistics based on overviews or similar.
forceWhether to force scanning of the whole raster.
Returns:
a list ($min, $max, $mean, $stddev).
scalar Geo::GDAL::Band::NoDataValue ( scalar  NoDataValue)
Parameters:
NoDataValue[optional] Get or set the no data value.
Note:
There does not exist a good way to clear the no data value. $band->NoDataValue(undef) does not do what you want.
Returns:
the nodata value.
scalar Geo::GDAL::Band::ReadRaster ( scalar  xoff,
scalar  yoff,
scalar  xsize,
scalar  ysize,
scalar  buf_xsize = undef,
scalar  buf_ysize = undef,
scalar  buf_type = undef 
)
Parameters:
xoff
yoff
xsize
ysize
buf_xsize
buf_ysize
buf_type
Returns:
the data in a binary buffer. Use the unpack function of Perl to get the data from the buffer.
listref Geo::GDAL::Band::ReadTile ( scalar  xoff = 0,
scalar  yoff = 0,
scalar  xsize = <width>,
scalar  ysize = <height> 
)
Parameters:
xoff
yoff
xsize
ysize
Returns:
a two-dimensional Perl array, organizes as data->[y][x], y = 0..height-1, x = 0..width-1.
Geo::GDAL::Band::SetDefaultRAT ( scalar  AttributeTable)
Parameters:
AttributeTablea Geo::GDAL::RasterAttributeTable object
Geo::GDAL::Band::SetNoDataValue ( scalar  NoDataValue)
Parameters:
NoDataValueA number. undef does not do what it should do.
Geo::GDAL::Band::SetRasterCategoryNames ( scalar  names)
Parameters:
names
Geo::GDAL::Band::SetRasterColorInterpretation ( )
Deprecated:
use Geo::GDAL::Band::ColorInterpretation, which understands strings
Geo::GDAL::Band::SetRasterColorTable ( scalar  ColorTable)
Parameters:
ColorTableA color table object.
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).

Parameters:
min
max
mean
stddev
Geo::GDAL::Band::WriteRaster ( scalar  xoff,
scalar  yoff,
scalar  xsize,
scalar  ysize,
scalar  buf,
scalar  buf_xsize = undef,
scalar  buf_ysize = undef,
scalar  buf_type = undef 
)
Parameters:
xoff
yoff
xsize
ysize
bufThe data to be written in a binary buffer. Use the pack function of Perl to prepare a buffer.
buf_xsize
buf_ysize
buf_type
Geo::GDAL::Band::WriteTile ( scalar  data,
scalar  xoff = 0,
scalar  yoff = 0 
)
Parameters:
dataA two-dimensional Perl array, organizes as data->[y][x], y = 0..height-1, x = 0..width-1.
xoff
yoff

Member Data Documentation

scalar (access as $band->{XSize})

scalar (access as $band->{YSize})


The documentation for this class was generated from the following file: