|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gdal.gdal.MajorObject
org.gdal.gdal.Band
public class Band
Class Band is an uninstanciable class providing various methods to access a single raster band (or channel).
The Band class is a binding for the C++ GDALRasterBand class.
Band objects are returned by methods from other classes, such as Dataset.GetRasterBand() Users of the Java bindings must be aware that the Java primitive types byte, short, int are signed types, whereas a few GDAL data types (GDT_Byte, GDT_UInt16 and GDT_UInt32) are unsigned. To read/write those data types, you may have to choose a "larger" type for example (short/GDT_Int16 for GDT_Byte, int/GDT_Int32 for GDT_UInt16, double/GDT_Float64 for GDT_UInt32), or use some tricks to hold unsigned values into signed data type. For example :
byte[] byteArray = new byte[xsize * ysize]; byte[] byteArray2 = new byte[xsize * ysize]; band.ReadRaster(0, 0, xsize, ysize, gdalconst.GDT_Byte, byteArray); for(int j=0; j < ysize; j++) { for(int i=0; i < xsize; i++) { byte bVal = byteArray[j*xsize+i]; // ranging from -128 to 127 int nVal = ((int)bVal) & 0xff; // remapped to range from 0 to 255 int nVal2; if (nVal > threshold) nVal2 = 255; else nVal2 = 0; byte bVal2 = (nVal2 > 127) ? nVal2 - 256 : nVal2; // remapped to range from -128 to 127 byteArray2[j*xsize+i] = bVal2; } } band2.WriteRaster(0, 0, xsize, ysize, gdalconst.GDT_Byte, byteArray2);
Method Summary | |
---|---|
int |
Checksum()
Compute checksum for while image. |
int |
Checksum(int xoff,
int yoff,
int xsize,
int ysize)
Compute checksum for image region. |
void |
ComputeBandStats(double[] meanAndStdDevArray)
Compute mean and standard deviation values. |
void |
ComputeBandStats(double[] meanAndStdDevArray,
int samplestep)
Compute mean and standard deviation values. |
void |
ComputeRasterMinMax(double[] minMaxArray)
Compute the min/max values for a band. |
void |
ComputeRasterMinMax(double[] minMaxArray,
int approx_ok)
Compute the min/max values for a band. |
int |
ComputeStatistics(boolean approx_ok)
Compute image statistics. |
int |
ComputeStatistics(boolean approx_ok,
double[] min,
double[] max)
Compute image statistics. |
int |
ComputeStatistics(boolean approx_ok,
double[] min,
double[] max,
double[] mean,
double[] stddev)
Compute image statistics. |
int |
ComputeStatistics(boolean approx_ok,
double[] min,
double[] max,
double[] mean,
double[] stddev,
ProgressCallback callback)
Compute image statistics. |
int |
CreateMaskBand(int nFlags)
Adds a mask band to the current band. |
void |
delete()
Deprecated. Do not do anything... |
int |
Fill(double real_fill)
Fill this band with a constant value. |
int |
Fill(double real_fill,
double imag_fill)
Fill this band with a constant value. |
void |
FlushCache()
Flush raster data cache. |
int |
GetBand()
Fetch the band number. |
void |
GetBlockSize(int[] pnBlockXSize,
int[] pnBlockYSize)
Fetch the "natural" block size of this band. |
int |
GetBlockXSize()
Fetch the "natural" block width of this band |
int |
GetBlockYSize()
Fetch the "natural" block height of this band |
int |
GetColorInterpretation()
How should this band be interpreted as color? |
ColorTable |
GetColorTable()
Fetch the color table associated with band. |
int |
getDataType()
Return the data type of the band. |
int |
GetDefaultHistogram(double[] min_ret,
double[] max_ret,
int[][] histogram_ret)
Fetch default raster histogram. |
int |
GetDefaultHistogram(double[] min_ret,
double[] max_ret,
int[][] histogram_ret,
boolean force)
Fetch default raster histogram. |
int |
GetDefaultHistogram(double[] min_ret,
double[] max_ret,
int[][] histogram_ret,
boolean force,
ProgressCallback callback)
Fetch default raster histogram. |
RasterAttributeTable |
GetDefaultRAT()
Fetch default Raster Attribute Table. |
int |
GetHistogram(double min,
double max,
int[] histogram)
Compute raster histogram. |
int |
GetHistogram(double min,
double max,
int[] histogram,
boolean include_out_of_range,
boolean approx_ok)
Compute raster histogram. |
int |
GetHistogram(double min,
double max,
int[] histogram,
boolean include_out_of_range,
boolean approx_ok,
ProgressCallback callback)
Compute raster histogram. |
int |
GetHistogram(int[] histogram)
Compute raster histogram. |
Band |
GetMaskBand()
Return the mask band associated with the band. |
int |
GetMaskFlags()
Return the status flags of the mask band associated with the band. |
void |
GetMaximum(Double[] val)
Fetch the maximum value for this band. |
void |
GetMinimum(Double[] val)
Fetch the minimum value for this band. |
void |
GetNoDataValue(Double[] val)
Fetch the no data value for this band. |
void |
GetOffset(Double[] val)
Fetch the raster value offset. |
Band |
GetOverview(int i)
Fetch overview raster band object. |
int |
GetOverviewCount()
Return the number of overview layers available. |
Vector |
GetRasterCategoryNames()
Fetch the list of category names for this raster. |
int |
GetRasterColorInterpretation()
How should this band be interpreted as color? |
ColorTable |
GetRasterColorTable()
Fetch the color table associated with band. |
int |
GetRasterDataType()
Return the data type of the band. |
void |
GetScale(Double[] val)
Fetch the raster value scale. |
int |
GetStatistics(boolean approx_ok,
boolean force,
double[] min,
double[] max,
double[] mean,
double[] stddev)
Fetch image statistics. |
int |
GetStatistics(int approx_ok,
int force,
double[] min,
double[] max,
double[] mean,
double[] stddev)
Fetch image statistics. |
String |
GetUnitType()
Return raster unit type. |
int |
getXSize()
Fetch XSize of raster. |
int |
GetXSize()
Fetch XSize of raster. |
int |
getYSize()
Fetch YSize of raster. |
int |
GetYSize()
Fetch YSize of raster. |
boolean |
HasArbitraryOverviews()
Check for arbitrary overviews. |
int |
ReadBlock_Direct(int nXBlockOff,
int nYBlockOff,
ByteBuffer nioBuffer)
Read a block of image data efficiently. |
ByteBuffer |
ReadRaster_Direct(int xoff,
int yoff,
int xsize,
int ysize)
Read a region of image data for this band. |
int |
ReadRaster_Direct(int xoff,
int yoff,
int xsize,
int ysize,
ByteBuffer nioBuffer)
Read a region of image data for this band. |
ByteBuffer |
ReadRaster_Direct(int xoff,
int yoff,
int xsize,
int ysize,
int buf_type)
Read a region of image data for this band. |
int |
ReadRaster_Direct(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
ByteBuffer nioBuffer)
Read a region of image data for this band. |
ByteBuffer |
ReadRaster_Direct(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type)
Read a region of image data for this band. |
int |
ReadRaster_Direct(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
ByteBuffer nioBuffer)
Read a region of image data for this band. |
int |
ReadRaster_Direct(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
ByteBuffer nioBuffer,
int nPixelSpace,
int nLineSpace)
Read a region of image data for this band. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
byte[] array)
Read a region of image data for this band. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
double[] array)
Read a region of image data for this band. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
float[] array)
Read a region of image data for this band. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int[] array)
Read a region of image data for this band. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_type,
byte[] array)
Read a region of image data for this band. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_type,
double[] array)
Read a region of image data for this band. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_type,
float[] array)
Read a region of image data for this band. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_type,
int[] array)
Read a region of image data for this band. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
byte[] array)
Read a region of image data for this band. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
byte[] array,
int nPixelSpace,
int nLineSpace)
Read a region of image data for this band. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
double[] array)
Read a region of image data for this band. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
double[] array,
int nPixelSpace,
int nLineSpace)
Read a region of image data for this band. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
float[] array)
Read a region of image data for this band. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
float[] array,
int nPixelSpace,
int nLineSpace)
Read a region of image data for this band. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
int[] array)
Read a region of image data for this band. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
int[] array,
int nPixelSpace,
int nLineSpace)
Read a region of image data for this band. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
short[] array)
Read a region of image data for this band. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
short[] array,
int nPixelSpace,
int nLineSpace)
Read a region of image data for this band. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_type,
short[] array)
Read a region of image data for this band. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
short[] array)
Read a region of image data for this band. |
int |
SetColorInterpretation(int eColorInterp)
Set color interpretation of a band. |
int |
SetColorTable(ColorTable colorTable)
Set the raster color table. |
int |
SetDefaultHistogram(double min,
double max,
int[] histogram)
Set default histogram |
int |
SetDefaultRAT(RasterAttributeTable table)
Set default Raster Attribute Table. |
int |
SetNoDataValue(double nodataValue)
Set the no data value for this band. |
int |
SetRasterCategoryNames(Vector names)
Set the category names for this band. |
int |
SetRasterColorInterpretation(int eColorInterp)
Set color interpretation of a band. |
int |
SetRasterColorTable(ColorTable colorTable)
Set the raster color table. |
int |
SetStatistics(double min,
double max,
double mean,
double stddev)
Set statistics on band. |
int |
WriteBlock_Direct(int nXBlockOff,
int nYBlockOff,
ByteBuffer nioBuffer)
Write a block of image data efficiently. |
int |
WriteRaster_Direct(int xoff,
int yoff,
int xsize,
int ysize,
ByteBuffer nioBuffer)
Write a region of image data for this band. |
int |
WriteRaster_Direct(int xoff,
int yoff,
int xsize,
int ysize,
int buf_type,
ByteBuffer nioBuffer)
Write a region of image data for this band. |
int |
WriteRaster_Direct(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
ByteBuffer nioBuffer)
Write a region of image data for this band. |
int |
WriteRaster_Direct(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
ByteBuffer nioBuffer)
Write a region of image data for this band. |
int |
WriteRaster_Direct(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
ByteBuffer nioBuffer,
int nPixelSpace,
int nLineSpace)
Write a region of image data for this band. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
byte[] array)
Write a region of image data for this band. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
double[] array)
Write a region of image data for this band. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
float[] array)
Write a region of image data for this band. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int[] array)
Write a region of image data for this band. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_type,
byte[] array)
Write a region of image data for this band. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_type,
double[] array)
Write a region of image data for this band. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_type,
float[] array)
Write a region of image data for this band. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_type,
int[] array)
Write a region of image data for this band. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
byte[] array)
Write a region of image data for this band. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
byte[] array,
int nPixelSpace,
int nLineSpace)
Write a region of image data for this band. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
double[] array)
Write a region of image data for this band. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
double[] array,
int nPixelSpace,
int nLineSpace)
Write a region of image data for this band. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
float[] array)
Write a region of image data for this band. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
float[] array,
int nPixelSpace,
int nLineSpace)
Write a region of image data for this band. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
int[] array)
Write a region of image data for this band. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
int[] array,
int nPixelSpace,
int nLineSpace)
Write a region of image data for this band. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
short[] array)
Write a region of image data for this band. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
short[] array,
int nPixelSpace,
int nLineSpace)
Write a region of image data for this band. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_type,
short[] array)
Write a region of image data for this band. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
short[] array)
Write a region of image data for this band. |
Methods inherited from class org.gdal.gdal.MajorObject |
---|
GetDescription, GetMetadata_Dict, GetMetadata_Dict, GetMetadata_List, GetMetadata_List, GetMetadataItem, GetMetadataItem, SetDescription, SetMetadata, SetMetadata, SetMetadata, SetMetadata, SetMetadata, SetMetadata, SetMetadataItem, SetMetadataItem |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void delete()
delete
in class MajorObject
public int GetXSize()
public int GetYSize()
public int GetRasterDataType()
public int GetBlockXSize()
GetBlockSize(int[] pnBlockXSize, int[] pnBlockYSize)
public int GetBlockYSize()
GetBlockSize(int[] pnBlockXSize, int[] pnBlockYSize)
public int Checksum()
public int GetStatistics(boolean approx_ok, boolean force, double[] min, double[] max, double[] mean, double[] stddev)
If force is false results will only be returned if it can be done quickly (ie. without scanning the data). If force is false and results cannot be returned efficiently, the method will return CE_Warning but no warning will have been issued. This is a non-standard use of the CE_Warning return value to indicate "nothing done".
Note that file formats using PAM (Persistent Auxilary Metadata) services will generally cache statistics in the .pam file allowing fast fetch after the first request.
approx_ok
- If true statistics may be computed based on overviews
or a subset of all tiles.force
- If true statistics will only be returned if it can
be done without rescanning the image.min
- Allocated array of one double into which to load image minimum (may be null).max
- Allocated array of one double into which to load image maximum (may be null).mean
- Allocated array of one double into which to load image mean (may be null).stddev
- Allocated array of one double into which to load image standard deviation
(may be null).
public int ReadRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, ByteBuffer nioBuffer)
ReadRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, java.nio.ByteBuffer nioBuffer, int nPixelSpace, int nLineSpace)
public int ReadRaster_Direct(int xoff, int yoff, int xsize, int ysize, ByteBuffer nioBuffer)
ReadRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, java.nio.ByteBuffer nioBuffer, int nPixelSpace, int nLineSpace)
public ByteBuffer ReadRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type)
ReadRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, java.nio.ByteBuffer nioBuffer, int nPixelSpace, int nLineSpace)
public ByteBuffer ReadRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_type)
ReadRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, java.nio.ByteBuffer nioBuffer, int nPixelSpace, int nLineSpace)
public ByteBuffer ReadRaster_Direct(int xoff, int yoff, int xsize, int ysize)
ReadRaster_Direct(int xoff, int yoff, int xsize, int ysize, java.nio.ByteBuffer nioBuffer)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_type, byte[] array)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int nPixelSpace, int nLineSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, byte[] array)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int nPixelSpace, int nLineSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_type, short[] array)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, short[] array, int nPixelSpace, int nLineSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, short[] array)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, short[] array, int nPixelSpace, int nLineSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_type, int[] array)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, int[] array, int nPixelSpace, int nLineSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int[] array)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, int[] array, int nPixelSpace, int nLineSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_type, float[] array)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, float[] array, int nPixelSpace, int nLineSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, float[] array)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, float[] array, int nPixelSpace, int nLineSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_type, double[] array)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, double[] array, int nPixelSpace, int nLineSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, double[] array)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, double[] array, int nPixelSpace, int nLineSpace)
public int WriteRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, ByteBuffer nioBuffer)
WriteRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, java.nio.ByteBuffer nioBuffer, int nPixelSpace, int nLineSpace)
public int WriteRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_type, ByteBuffer nioBuffer)
WriteRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, java.nio.ByteBuffer nioBuffer, int nPixelSpace, int nLineSpace)
public int WriteRaster_Direct(int xoff, int yoff, int xsize, int ysize, ByteBuffer nioBuffer)
WriteRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, java.nio.ByteBuffer nioBuffer, int nPixelSpace, int nLineSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_type, byte[] array)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int nPixelSpace, int nLineSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, byte[] array)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int nPixelSpace, int nLineSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_type, short[] array)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, short[] array, int nPixelSpace, int nLineSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, short[] array)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, short[] array, int nPixelSpace, int nLineSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_type, int[] array)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, int[] array, int nPixelSpace, int nLineSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int[] array)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, int[] array, int nPixelSpace, int nLineSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_type, float[] array)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, float[] array, int nPixelSpace, int nLineSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, float[] array)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, float[] array, int nPixelSpace, int nLineSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_type, double[] array)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, double[] array, int nPixelSpace, int nLineSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, double[] array)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, double[] array, int nPixelSpace, int nLineSpace)
public int getXSize()
public int getYSize()
public int getDataType()
public int GetBand()
public void GetBlockSize(int[] pnBlockXSize, int[] pnBlockYSize)
However, for tiled images this will typically be the tile size.
Note that the X and Y block sizes don't have to divide the image size evenly, meaning that right and bottom edge blocks may be incomplete. See ReadBlock_Direct() for an example of code dealing with these issues.
pnBlockXSize
- allocated array of 1 integer to put the X block size into or null.pnBlockYSize
- allocated array of 1 integer to put the Y block size into or null.public int GetColorInterpretation()
public int GetRasterColorInterpretation()
public int SetColorInterpretation(int eColorInterp)
eColorInterp
- the new color interpretation to apply to this band.
public int SetRasterColorInterpretation(int eColorInterp)
eColorInterp
- the new color interpretation to apply to this band.
public void GetNoDataValue(Double[] val)
val
- empty allocated array of type Doube[] of size 1. val[0] will contain a Double object
with the no data value if available, other val[0] will contain nullpublic int SetNoDataValue(double nodataValue)
nodataValue
- the value to set.
public String GetUnitType()
public Vector GetRasterCategoryNames()
public int SetRasterCategoryNames(Vector names)
names
- a vector of strings with category names. May
be ,ull to just clear the existing list.
public void GetMinimum(Double[] val)
val
- empty allocated array of type Doube[] of size 1. val[0] will contain a Double object
with the minimum value if available, other val[0] will contain nullpublic void GetMaximum(Double[] val)
val
- empty allocated array of type Doube[] of size 1. val[0] will contain a Double object
with the maximum value if available, other val[0] will contain nullpublic void GetOffset(Double[] val)
Units value = (raw value * scale) + offset
For file formats that don't know this intrinsically, no value will be returned
val
- empty allocated array of type Doube[] of size 1. val[0] will contain a Double object
with the offset value if available, other val[0] will contain nullpublic void GetScale(Double[] val)
Units value = (raw value * scale) + offset
For file formats that don't know this intrinsically, no value will be returned
val
- empty allocated array of type Doube[] of size 1. val[0] will contain a Double object
with the scale value if available, other val[0] will contain nullpublic int GetStatistics(int approx_ok, int force, double[] min, double[] max, double[] mean, double[] stddev)
GetStatistics(boolean approx_ok, boolean force, double[] min, double[] max, double[] mean, double[] stddev)
public int ComputeStatistics(boolean approx_ok, double[] min, double[] max, double[] mean, double[] stddev, ProgressCallback callback)
Once computed, the statistics will generally be "set" back on the raster band using SetStatistics().
approx_ok
- If true statistics may be computed based on overviews
or a subset of all tiles.min
- Allocated array of one double into which to load image minimum (may be null).max
- Allocated array of one double into which to load image maximum (may be null).mean
- Allocated array of one double into which to load image mean (may be null).stddev
- Allocated array of one double into which to load image standard deviation
(may be null).callback
- for reporting algorithm progress. May be null
public int ComputeStatistics(boolean approx_ok, double[] min, double[] max, double[] mean, double[] stddev)
ComputeStatistics(boolean approx_ok, double[] min, double[] max, double[] mean, double[] stddev, ProgressCallback callback)
public int ComputeStatistics(boolean approx_ok, double[] min, double[] max)
ComputeStatistics(boolean approx_ok, double[] min, double[] max, double[] mean, double[] stddev, ProgressCallback callback)
public int ComputeStatistics(boolean approx_ok)
ComputeStatistics(boolean approx_ok, double[] min, double[] max, double[] mean, double[] stddev, ProgressCallback callback)
public int SetStatistics(double min, double max, double mean, double stddev)
The default implementation stores them as metadata, and will only work on formats that can save arbitrary metadata. This method cannot detect whether metadata will be properly saved and so may return CE_None even if the statistics will never be saved.
min
- minimum pixel value.max
- maximum pixel value.mean
- mean (average) of all pixel values.stddev
- Standard deviation of all pixel values.
public int GetOverviewCount()
public Band GetOverview(int i)
i
- overview index between 0 and GetOverviewCount()-1.
public int Checksum(int xoff, int yoff, int xsize, int ysize)
xoff
- pixel offset of window to read.yoff
- line offset of window to read.xsize
- pixel size of window to read.ysize
- line size of window to read.
public void ComputeRasterMinMax(double[] minMaxArray, int approx_ok)
If approx_ok is 0, then all pixels will be read and used to compute an exact range.
minMaxArray
- the allocated array of 2 doubles in which the minimum (minMaxArray[0]) and the
maximum (minMaxArray[1]) are returned.approx_ok
- 1 if an approximate (faster) answer is OK, otherwise 0.public void ComputeRasterMinMax(double[] minMaxArray)
ComputeRasterMinMax(double[] minMaxArray, int approx_ok)
public void ComputeBandStats(double[] meanAndStdDevArray, int samplestep)
meanAndStdDevArray
- the allocated array of 2 doubles in which the mean value (meanAndStdDevArray[0])
and the standard deviation (meanAndStdDevArray[1]) are returnedsamplestep
- step in number of linespublic void ComputeBandStats(double[] meanAndStdDevArray)
ComputeBandStats(double[] meanAndStdDevArray, int samplestep)
public int Fill(double real_fill, double imag_fill)
real_fill
- Real component of fill valueimag_fill
- Imaginary component of fill value, defaults to zero
public int Fill(double real_fill)
Fill(double real_fill, double imag_fill)
public void FlushCache()
public ColorTable GetRasterColorTable()
public ColorTable GetColorTable()
public int SetRasterColorTable(ColorTable colorTable)
colorTable
- the color table to apply. This may be null to clear the color
table (where supported).
public int SetColorTable(ColorTable colorTable)
colorTable
- the color table to apply. This may be null to clear the color
table (where supported).
public RasterAttributeTable GetDefaultRAT()
public int SetDefaultRAT(RasterAttributeTable table)
table
- the RAT to assign to the band.
public Band GetMaskBand()
Note that the GetMaskBand() should always return a GDALRasterBand mask, even if it is only an all 255 mask with the flags indicating GMF_ALL_VALID.
public int GetMaskFlags()
public int CreateMaskBand(int nFlags)
public int SetDefaultHistogram(double min, double max, int[] histogram)
public boolean HasArbitraryOverviews()
public int ReadRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, ByteBuffer nioBuffer, int nPixelSpace, int nLineSpace)
The nPixelSpace and nLineSpace parameters allow reading into or writing from unusually organized buffers. This is primarily used for buffers containing more than one bands raster data in interleaved format.
Some formats may efficiently implement decimation into a buffer by reading from lower resolution overview images.
For highest performance full resolution data access, read on "block boundaries" as returned by GetBlockSize(int[], int[]), or use the ReadBlock(int, int, java.nio.ByteBuffer) method.
When requesting a multi-byte datatype (GDT_Int16, GDT_Int32, GDT_Float32, ...), you should generally set the byte order of the buffer to the native order of the machine with nioBuffer.order(ByteOrder.nativeOrder()) (the default is BIG_ENDIAN) if you use the getShort(), getInt(), getFloat() etc... methods of the ByteBuffer class.
xoff
- The pixel offset to the top left corner of the region
of the band to be accessed. This would be zero to start from the left side.yoff
- The line offset to the top left corner of the region
of the band to be accessed. This would be zero to start from the top.xsize
- The width of the region of the band to be accessed in pixels.ysize
- The height of the region of the band to be accessed in lines.buf_xsize
- the width of the buffer image into which the desired region is
to be read, or from which it is to be written.buf_ysize
- the height of the buffer image into which the desired region is
to be read, or from which it is to be written.buf_type
- the type of the pixel values in the nioBuffer data buffer. One of
gdalconstConstants.GDT_Byte,
gdalconstConstants.GDT_Int16, ...
The pixel values will automatically be translated to/from the GDALRasterBand
data type as needed.nioBuffer
- The buffer into which the data should be read.
This buffer must contain at least buf_xsize *
buf_ysize words of type buf_type. It is organized in left to right,
top to bottom pixel order. Spacing is controlled by the nPixelSpace,
and nLineSpace parameters.nPixelSpace
- The byte offset from the start of one pixel value in
the buffer to the start of the next pixel value within a scanline. If defaulted
(0) the size of the datatype buf_type is used.nLineSpace
- The byte offset from the start of one scanline in
the buffer to the start of the next. If defaulted the size of the datatype
buf_type * buf_xsize is used.
public int ReadRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, ByteBuffer nioBuffer)
ReadRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, java.nio.ByteBuffer nioBuffer, int nPixelSpace, int nLineSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int nPixelSpace, int nLineSpace)
The nPixelSpace and nLineSpace parameters allow reading into or writing from unusually organized buffers. This is primarily used for buffers containing more than one bands raster data in interleaved format.
Some formats may efficiently implement decimation into a buffer by reading from lower resolution overview images.
For highest performance full resolution data access, read on "block boundaries" as returned by GetBlockSize(int[], int[]), or use the ReadBlock(int, int, java.nio.ByteBuffer) method.
xoff
- The pixel offset to the top left corner of the region
of the band to be accessed. This would be zero to start from the left side.yoff
- The line offset to the top left corner of the region
of the band to be accessed. This would be zero to start from the top.xsize
- The width of the region of the band to be accessed in pixels.ysize
- The height of the region of the band to be accessed in lines.buf_xsize
- the width of the buffer image into which the desired region is
to be read, or from which it is to be written.buf_ysize
- the height of the buffer image into which the desired region is
to be read, or from which it is to be written.buf_type
- the type of the pixel values in the array. One of
gdalconstConstants.GDT_Byte,
gdalconstConstants.GDT_Int16, ...
The pixel values will automatically be translated to/from the Band
data type as needed. The GDAL type must be consistant with the type of the Java array.array
- The buffer into which the data should be read.
This buffer must contain at least buf_xsize *
buf_ysize words of type buf_type. It is organized in left to right,
top to bottom pixel order. Spacing is controlled by the nPixelSpace,
and nLineSpace parameters.nPixelSpace
- The byte offset from the start of one pixel value in
the buffer to the start of the next pixel value within a scanline. If defaulted
(0) the size of the datatype buf_type is used.nLineSpace
- The byte offset from the start of one scanline in
the buffer to the start of the next. If defaulted the size of the datatype
buf_type * buf_xsize is used.
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int nPixelSpace, int nLineSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, short[] array, int nPixelSpace, int nLineSpace)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int nPixelSpace, int nLineSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, short[] array)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, short[] array, int nPixelSpace, int nLineSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, int[] array, int nPixelSpace, int nLineSpace)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int nPixelSpace, int nLineSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, int[] array)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, int[] array, int nPixelSpace, int nLineSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, float[] array, int nPixelSpace, int nLineSpace)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int nPixelSpace, int nLineSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, float[] array)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, float[] array, int nPixelSpace, int nLineSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, double[] array, int nPixelSpace, int nLineSpace)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int nPixelSpace, int nLineSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, double[] array)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, double[] array, int nPixelSpace, int nLineSpace)
public int WriteRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, ByteBuffer nioBuffer, int nPixelSpace, int nLineSpace)
The nPixelSpace and nLineSpace parameters allow reading into or writing from unusually organized buffers. This is primarily used for buffers containing more than one bands raster data in interleaved format.
Some formats may efficiently implement decimation into a buffer by reading from lower resolution overview images.
For highest performance full resolution data access, write on "block boundaries" as returned by GetBlockSize(int[], int[]), or use the WriteBlock(int, int, java.nio.ByteBuffer) method.
Before writing into a multi-byte datatype buffer (GDT_Int16, GDT_Int32, GDT_Float32, ...), you should generally set the byte order of the buffer to the native order of the machine with nioBuffer.order(ByteOrder.nativeOrder()) (the default is BIG_ENDIAN) if you use the putShort(), putInt(), putFloat(), ... methods of the ByteBuffer class.
xoff
- The pixel offset to the top left corner of the region
of the band to be accessed. This would be zero to start from the left side.yoff
- The line offset to the top left corner of the region
of the band to be accessed. This would be zero to start from the top.xsize
- The width of the region of the band to be accessed in pixels.ysize
- The height of the region of the band to be accessed in lines.buf_xsize
- the width of the buffer image from which the desired region is to be written.buf_ysize
- the height of the buffer image from which the desired region is to be written.buf_type
- the type of the pixel values in the nioBuffer data buffer. One of
gdalconstConstants.GDT_Byte,
gdalconstConstants.GDT_Int16, ...
The pixel values will automatically be translated to/from the GDALRasterBand
data type as needed.nioBuffer
- The buffer into which the data should be read.
This buffer must contain at least buf_xsize *
buf_ysize words of type buf_type. It is organized in left to right,
top to bottom pixel order. Spacing is controlled by the nPixelSpace,
and nLineSpace parameters.nPixelSpace
- The byte offset from the start of one pixel value in
the buffer to the start of the next pixel value within a scanline. If defaulted
(0) the size of the datatype buf_type is used.nLineSpace
- The byte offset from the start of one scanline in
the buffer to the start of the next. If defaulted the size of the datatype
buf_type * buf_xsize is used.
public int WriteRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, ByteBuffer nioBuffer)
WriteRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, java.nio.ByteBuffer nioBuffer, int nPixelSpace, int nLineSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int nPixelSpace, int nLineSpace)
The nPixelSpace and nLineSpace parameters allow reading into or writing from unusually organized buffers. This is primarily used for buffers containing more than one bands raster data in interleaved format.
Some formats may efficiently implement decimation into a buffer by reading from lower resolution overview images.
For highest performance full resolution data access, write on "block boundaries" as returned by GetBlockSize(int[], int[]), or use the WriteBlock(int, int, java.nio.ByteBuffer) method.
xoff
- The pixel offset to the top left corner of the region
of the band to be accessed. This would be zero to start from the left side.yoff
- The line offset to the top left corner of the region
of the band to be accessed. This would be zero to start from the top.xsize
- The width of the region of the band to be accessed in pixels.ysize
- The height of the region of the band to be accessed in lines.buf_xsize
- the width of the buffer image from which the desired region is to be written.buf_ysize
- the height of the buffer image from which the desired region is to be written.buf_type
- the type of the pixel values in the array. One of
gdalconstConstants.GDT_Byte,
gdalconstConstants.GDT_Int16, ...
The pixel values will automatically be translated to/from the Band
data type as needed. The GDAL type must be consistant with the type of the Java array.array
- The buffer into which the data should be read.
This buffer must contain at least buf_xsize *
buf_ysize words of type buf_type. It is organized in left to right,
top to bottom pixel order. Spacing is controlled by the nPixelSpace,
and nLineSpace parameters.nPixelSpace
- The byte offset from the start of one pixel value in
the buffer to the start of the next pixel value within a scanline. If defaulted
(0) the size of the datatype buf_type is used.nLineSpace
- The byte offset from the start of one scanline in
the buffer to the start of the next. If defaulted the size of the datatype
buf_type * buf_xsize is used.
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int nPixelSpace, int nLineSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, short[] array, int nPixelSpace, int nLineSpace)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int nPixelSpace, int nLineSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, short[] array)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, short[] array, int nPixelSpace, int nLineSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, int[] array, int nPixelSpace, int nLineSpace)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int nPixelSpace, int nLineSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, int[] array)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, int[] array, int nPixelSpace, int nLineSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, float[] array, int nPixelSpace, int nLineSpace)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int nPixelSpace, int nLineSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, float[] array)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, float[] array, int nPixelSpace, int nLineSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, double[] array, int nPixelSpace, int nLineSpace)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int nPixelSpace, int nLineSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, double[] array)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, double[] array, int nPixelSpace, int nLineSpace)
public int ReadBlock_Direct(int nXBlockOff, int nYBlockOff, ByteBuffer nioBuffer)
nXBlockOff
- the horizontal block offset, with zero indicating
the left most block, 1 the next block and so forth.nYBlockOff
- the vertical block offset, with zero indicating
the left most block, 1 the next block and so forth.nioBuffer
- the buffer into which the data will be read. The buffer
must be large enough to hold GetBlockXSize()*GetBlockYSize() words
of type GetRasterDataType().
public int WriteBlock_Direct(int nXBlockOff, int nYBlockOff, ByteBuffer nioBuffer)
nXBlockOff
- the horizontal block offset, with zero indicating
the left most block, 1 the next block and so forth.nYBlockOff
- the vertical block offset, with zero indicating
the left most block, 1 the next block and so forth.nioBuffer
- the buffer from which the data will be written. The buffer
must be large enough to hold GetBlockXSize()*GetBlockYSize() words
of type GetRasterDataType().
public int GetHistogram(double min, double max, int[] histogram, boolean include_out_of_range, boolean approx_ok, ProgressCallback callback)
For example to compute a simple 256 entry histogram of eight bit data, the following would be suitable. The unusual bounds are to ensure that bucket boundaries don't fall right on integer values causing possible errors due to rounding after scaling.
int anHistogram = new int[256]; band.GetHistogram( -0.5, 255.5, 256, anHistogram, false, false, null);
Note that setting approx_ok will generally result in a subsampling of the file, and will utilize overviews if available. It should generally produce a representative histogram for the data that is suitable for use in generating histogram based luts for instance. Generally bApproxOK is much faster than an exactly computed histogram.
min
- the lower bound of the histogram.max
- the upper bound of the histogram.histogram
- allocated array into which the histogram totals are placed.include_out_of_range
- if true values below the histogram range will
mapped into anHistogram[0], and values above will be mapped into
anHistogram[anHistogram.length-1] otherwise out of range values are discarded.approx_ok
- true if an approximate, or incomplete histogram OK.callback
- for reporting algorithm progress. May be null
public int GetHistogram(double min, double max, int[] histogram, boolean include_out_of_range, boolean approx_ok)
GetHistogram(double min, double max, int[] histogram, boolean include_out_of_range, boolean approx_ok, ProgressCallback callback)
public int GetHistogram(double min, double max, int[] histogram)
GetHistogram(double min, double max, int[] histogram, boolean include_out_of_range, boolean approx_ok, ProgressCallback callback)
public int GetHistogram(int[] histogram)
GetHistogram(double min, double max, int[] histogram, boolean include_out_of_range, boolean approx_ok, ProgressCallback callback)
public int GetDefaultHistogram(double[] min_ret, double[] max_ret, int[][] histogram_ret, boolean force, ProgressCallback callback)
For example,
double[] dfMin = new double[1]; double[] dfMax = new double[1]; int[][] panHistogram = new int[1][]; int eErr = hBand.GetDefaultHistogram(dfMin, dfMax, panHistogram, true, new TermProgressCallback()); if( eErr == gdalconst.CE_None ) { int iBucket; int nBucketCount = panHistogram[0].length; System.out.print( " " + nBucketCount + " buckets from " + dfMin[0] + " to " + dfMax[0] + ":\n " ); for( iBucket = 0; iBucket < nBucketCount; iBucket++ ) System.out.print( panHistogram[0][iBucket] + " "); System.out.print( "\n" ); }
min_ret
- allocated array of one double that will contain the lower bound of the histogram.max_ret
- allocated array of one double that will contain the upper bound of the histogram.histogram_ret
- allocated array of one int[] into which the histogram totals are placed.force
- true to force the computation. If false and no default histogram is available, the method will return CE_Warningcallback
- for reporting algorithm progress. May be null
public int GetDefaultHistogram(double[] min_ret, double[] max_ret, int[][] histogram_ret, boolean force)
GetDefaultHistogram(double[] min_ret, double[] max_ret, int[][] histogram_ret, boolean force, ProgressCallback callback)
public int GetDefaultHistogram(double[] min_ret, double[] max_ret, int[][] histogram_ret)
GetDefaultHistogram(double[] min_ret, double[] max_ret, int[][] histogram_ret, boolean force, ProgressCallback callback)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |