|
|||||||||
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.Dataset
public class Dataset
Class Dataset is an uninstanciable class providing various methods to access a set of associated raster bands, usually from one file.
The Dataset class is a binding for the C++ GDALDataset class.
A dataset encapsulating one or more raster bands. Details are further discussed in the GDAL Data Model.
Dataset objects are returned by methods from other classes, such as gdal.Open() or Driver.Create() / Driver.CreateCopy()
Method Summary | |
---|---|
int |
AddBand()
Add a band to a dataset. |
int |
AddBand(int datatype)
Add a band to a dataset. |
int |
AddBand(int datatype,
Vector options)
Add a band to a dataset. |
int |
BuildOverviews(int[] overviewlist)
Build raster overview(s). |
int |
BuildOverviews(int[] overviewlist,
ProgressCallback callback)
Build raster overview(s). |
int |
BuildOverviews(String resampling,
int[] overviewlist)
Build raster overview(s). |
int |
BuildOverviews(String resampling,
int[] overviewlist,
ProgressCallback callback)
Build raster overview(s). |
int |
CreateMaskBand(int nFlags)
Adds a mask band to the current band. |
void |
delete()
Frees the native resource associated to a Dataset object and close the file. |
void |
FlushCache()
Flush all write cached data to disk. |
Driver |
GetDriver()
Fetch the driver to which this dataset relates. |
Vector |
GetFileList()
Fetch files forming dataset. |
int |
GetGCPCount()
Get number of GCPs. |
String |
GetGCPProjection()
Get output projection for GCPs. |
Vector |
GetGCPs()
Fetch GCPs. |
void |
GetGCPs(Vector gcpVector)
Fetch GCPs. |
double[] |
GetGeoTransform()
Fetch the affine transformation coefficients. |
void |
GetGeoTransform(double[] geoTransformArray)
Fetch the affine transformation coefficients. |
String |
GetProjection()
Fetch the projection definition string for this dataset. |
String |
GetProjectionRef()
Fetch the projection definition string for this dataset. |
Band |
GetRasterBand(int nBandId)
Fetch a band object for a dataset. |
int |
getRasterCount()
Fetch the number of raster bands on this dataset. |
int |
GetRasterCount()
Fetch the number of raster bands on this dataset. |
int |
getRasterXSize()
Fetch raster width in pixels. |
int |
GetRasterXSize()
Fetch raster width in pixels. |
int |
getRasterYSize()
Fetch raster height in pixels. |
int |
GetRasterYSize()
Fetch raster height in pixels. |
int |
ReadRaster_Direct(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
ByteBuffer nioBuffer,
int[] band_list)
Read a region of image data from multiple bands. |
int |
ReadRaster_Direct(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
ByteBuffer nioBuffer,
int[] band_list,
int nPixelSpace,
int nLineSpace,
int nBandSpace)
Read a region of image data from multiple bands. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
byte[] array,
int[] band_list)
Read a region of image data from multiple bands. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
byte[] array,
int[] band_list,
int nPixelSpace,
int nLineSpace,
int nBandSpace)
Read a region of image data from multiple bands. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
double[] array,
int[] band_list)
Read a region of image data from multiple bands. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
double[] array,
int[] band_list,
int nPixelSpace,
int nLineSpace,
int nBandSpace)
Read a region of image data from multiple bands. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
float[] array,
int[] band_list)
Read a region of image data from multiple bands. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
float[] array,
int[] band_list,
int nPixelSpace,
int nLineSpace,
int nBandSpace)
Read a region of image data from multiple bands. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
int[] array,
int[] band_list)
Read a region of image data from multiple bands. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
int[] array,
int[] band_list,
int nPixelSpace,
int nLineSpace,
int nBandSpace)
Read a region of image data from multiple bands. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
short[] array,
int[] band_list)
Read a region of image data from multiple bands. |
int |
ReadRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
short[] array,
int[] band_list,
int nPixelSpace,
int nLineSpace,
int nBandSpace)
Read a region of image data from multiple bands. |
int |
SetGCPs(GCP[] gcpArray,
String GCPProjection)
Assign GCPs. |
int |
SetGeoTransform(double[] geoTransformArray)
Set the affine transformation coefficients. |
int |
SetProjection(String projection)
Set the projection reference string for this dataset. |
int |
WriteRaster_Direct(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
ByteBuffer nioBuffer,
int[] band_list)
Write a region of image data from multiple bands. |
int |
WriteRaster_Direct(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
ByteBuffer nioBuffer,
int[] band_list,
int nPixelSpace,
int nLineSpace,
int nBandSpace)
Write a region of image data from multiple bands. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
byte[] array,
int[] band_list)
Write a region of image data from multiple bands. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
byte[] array,
int[] band_list,
int nPixelSpace,
int nLineSpace,
int nBandSpace)
Write a region of image data from multiple bands. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
double[] array,
int[] band_list)
Write a region of image data from multiple bands. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
double[] array,
int[] band_list,
int nPixelSpace,
int nLineSpace,
int nBandSpace)
Write a region of image data from multiple bands. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
float[] array,
int[] band_list)
Write a region of image data from multiple bands. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
float[] array,
int[] band_list,
int nPixelSpace,
int nLineSpace,
int nBandSpace)
Write a region of image data from multiple bands. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
int[] array,
int[] band_list)
Write a region of image data from multiple bands. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
int[] array,
int[] band_list,
int nPixelSpace,
int nLineSpace,
int nBandSpace)
Write a region of image data from multiple bands. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
short[] array,
int[] band_list)
Write a region of image data from multiple bands. |
int |
WriteRaster(int xoff,
int yoff,
int xsize,
int ysize,
int buf_xsize,
int buf_ysize,
int buf_type,
short[] array,
int[] band_list,
int nPixelSpace,
int nLineSpace,
int nBandSpace)
Write a region of image data from multiple bands. |
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()
The delete() method must be called when a dataset has been opened in update or creation mode, otherwise data might not be properly flushed to the disk. You cannot rely on the finalization to call delete().
delete
in class MajorObject
public int GetRasterXSize()
public int GetRasterYSize()
public int GetRasterCount()
public int BuildOverviews(int[] overviewlist, ProgressCallback callback)
BuildOverviews(String resampling, int[] overviewlist, ProgressCallback callback)
public int BuildOverviews(int[] overviewlist)
BuildOverviews(String resampling, int[] overviewlist, ProgressCallback callback)
public Vector GetGCPs()
public double[] GetGeoTransform()
GetGeoTransform(double[] geoTransformArray)
,
gdal.ApplyGeoTransform(double[] padfGeoTransform, double dfPixel, double dfLine, double[] pdfGeoX, double[] pdfGeoY)
,
gdal.InvGeoTransform(double[] gt_in)
public int getRasterXSize()
public int getRasterYSize()
public int getRasterCount()
public Driver GetDriver()
public Band GetRasterBand(int nBandId)
nBandId
- the index number of the band to fetch, from 1 to
GetRasterCount().
public String GetProjection()
public String GetProjectionRef()
public int SetProjection(String projection)
projection
- projection reference string.
public void GetGeoTransform(double[] geoTransformArray)
Xp = geoTransformArray[0] + P*geoTransformArray[1] + L*geoTransformArray[2]; Yp = geoTransformArray[3] + P*geoTransformArray[4] + L*geoTransformArray[5];
In a north up image, geoTransformArray[1] is the pixel width, and geoTransformArray[5] is the pixel height. The upper left corner of the upper left pixel is at position (geoTransformArray[0],geoTransformArray[3]).
The default transform is (0,1,0,0,0,1) and should be returned even when an error occurs, such as for formats that don't support transformation to projection coordinates.
NOTE: GetGeoTransform() isn't expressive enough to handle the variety of OGC Grid Coverages pixel/line to projection transformation schemes. Eventually this method will be depreciated in favour of a more general scheme.
geoTransformArray
- an existing six double array into which the
transformation will be placed.gdal.ApplyGeoTransform(double[] padfGeoTransform, double dfPixel, double dfLine, double[] pdfGeoX, double[] pdfGeoY)
,
gdal.InvGeoTransform(double[] gt_in)
public int SetGeoTransform(double[] geoTransformArray)
geoTransformArray
- a six double array containing the transformation
coefficients to be written with the dataset.
GetGeoTransform(double[] geoTransformArray)
public int BuildOverviews(String resampling, int[] overviewlist, ProgressCallback callback)
For example, to build overview level 2, 4 and 8 on all bands the following call could be made:
ds.BuildOverviews( "NEAREST", new int[] { 2, 4, 8 }, null );
resampling
- one of "NEAREST", "GAUSS", "AVERAGE",
"AVERAGE_MAGPHASE" or "NONE" controlling the downsampling method applied.overviewlist
- the list of overview decimation factors to build.callback
- for reporting progress or null
gdal.RegenerateOverviews(Band srcBand, Band[] overviewBands, String resampling, ProgressCallback callback)
public int BuildOverviews(String resampling, int[] overviewlist)
BuildOverviews(String resampling, int[] overviewlist, ProgressCallback callback)
public int GetGCPCount()
public String GetGCPProjection()
public void GetGCPs(Vector gcpVector)
gcpVector
- non null Vector objectpublic int SetGCPs(GCP[] gcpArray, String GCPProjection)
Most formats do not support setting of GCPs, even foramts that can handle GCPs. These formats will return CE_Failure.
gcpArray
- array of GCP objects being assignedGCPProjection
- the new OGC WKT coordinate system to assign for the
GCP output coordinates. This parameter should be "" if no output coordinate
system is known.
public void FlushCache()
Calling this method is generally not sufficient to ensure that the file is in a consistent state. You must call delete() for that
delete()
public int AddBand(int datatype, Vector options)
datatype
- the data type of the pixels in the new band.options
- a vector of options strings, each being "NAME=VALUE". The supported
options are format specific. null may be passed by default.
public int AddBand(int datatype)
AddBand(int datatype, java.util.Vector options)
public int AddBand()
AddBand(int datatype, java.util.Vector options)
public int CreateMaskBand(int nFlags)
public Vector GetFileList()
The returned filenames will normally be relative or absolute paths depending on the path used to originally open the dataset.
public int ReadRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, ByteBuffer nioBuffer, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
The nPixelSpace, nLineSpace and nBandSpace parameters allow reading into or writing from various organization of buffers.
For highest performance full resolution data access, read on "block boundaries" as returned by Band.GetBlockSize(int[], int[]), or use the Band.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(), ... 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.buf_ysize
- the height of the buffer image into which the desired
region is to be read.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 Band
data type as needed.nioBuffer
- The buffer into which the data will be written. This buffer must contain at least
buf_xsize * buf_ysize * nBandCount 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.band_list
- the list of band numbers being read/written.
Note band numbers are 1 based. This may be null to select the first
nBandCount bands.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.nBandSpace
- the byte offset from the start of one bands data to the
start of the next. If defaulted (zero) the value will be
nLineSpace * buf_ysize implying band sequential organization
of the data buffer.
public int ReadRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, ByteBuffer nioBuffer, int[] band_list)
ReadRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, java.nio.ByteBuffer nioBuffer, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
The nPixelSpace, nLineSpace and nBandSpace parameters allow reading into or writing from various organization of buffers.
For highest performance full resolution data access, read on "block boundaries" as returned by Band.GetBlockSize(int[], int[]), or use the Band.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.buf_ysize
- the height of the buffer image into which the desired
region is to be read.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 array into which the data will be written. This buffer must contain at least
buf_xsize * buf_ysize elements * nBandCount . It is organized
in left to right,top to bottom pixel order. Spacing is controlled by the
nPixelSpace, and nLineSpace parameters.band_list
- the list of band numbers being read/written.
Note band numbers are 1 based. This may be null to select the first
nBandCount bands.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.nBandSpace
- the byte offset from the start of one bands data to the
start of the next. If defaulted (zero) the value will be
nLineSpace * buf_ysize implying band sequential organization
of the data buffer.
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int[] band_list)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, short[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, short[] array, int[] band_list)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, short[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, int[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, int[] array, int[] band_list)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, int[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, float[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, float[] array, int[] band_list)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, float[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, double[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
public int ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, double[] array, int[] band_list)
ReadRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, double[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
public int WriteRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, ByteBuffer nioBuffer, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
The nPixelSpace, nLineSpace and nBandSpace parameters allow reading into or writing from various organization of buffers.
For highest performance full resolution data access, write on "block boundaries" as returned by Band.GetBlockSize(int[], int[]), or use the Band.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 Band
data type as needed.nioBuffer
- The buffer into which the data should be read, or from which
it should be written. This buffer must contain at least
buf_xsize * buf_ysize * nBandCount 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.band_list
- the list of band numbers being read/written.
Note band numbers are 1 based. This may be null to select the first
nBandCount bands.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.nBandSpace
- the byte offset from the start of one bands data to the
start of the next. If defaulted (zero) the value will be
nLineSpace * buf_ysize implying band sequential organization
of the data buffer.
public int WriteRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, ByteBuffer nioBuffer, int[] band_list)
WriteRaster_Direct(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, java.nio.ByteBuffer nioBuffer, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
The nPixelSpace, nLineSpace and nBandSpace parameters allow reading into or writing from various organization of buffers.
For highest performance full resolution data access, write on "block boundaries" as returned by Band.GetBlockSize(int[], int[]), or use the Band.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 array from which the data will be read. This buffer must contain at least
buf_xsize * buf_ysize elements * nBandCount . It is organized
in left to right,top to bottom pixel order. Spacing is controlled by the
nPixelSpace, and nLineSpace parameters.band_list
- the list of band numbers being read/written.
Note band numbers are 1 based. This may be null to select the first
nBandCount bands.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.nBandSpace
- the byte offset from the start of one bands data to the
start of the next. If defaulted (zero) the value will be
nLineSpace * buf_ysize implying band sequential organization
of the data buffer.
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int[] band_list)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, short[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, short[] array, int[] band_list)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, short[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, int[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, int[] array, int[] band_list)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, int[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, float[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, float[] array, int[] band_list)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, float[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, double[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, byte[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
public int WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, double[] array, int[] band_list)
WriteRaster(int xoff, int yoff, int xsize, int ysize, int buf_xsize, int buf_ysize, int buf_type, double[] array, int[] band_list, int nPixelSpace, int nLineSpace, int nBandSpace)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |