public class Transformer extends Object
Constructor and Description |
---|
Transformer(Dataset src_ds,
Dataset dst_ds,
Vector options)
Create image to image transformer.
|
Modifier and Type | Method and Description |
---|---|
void |
delete() |
boolean |
equals(Object obj) |
int |
hashCode() |
int |
TransformGeolocations(Band xBand,
Band yBand,
Band zBand) |
int |
TransformGeolocations(Band xBand,
Band yBand,
Band zBand,
ProgressCallback callback) |
int |
TransformGeolocations(Band xBand,
Band yBand,
Band zBand,
ProgressCallback callback,
Vector options) |
int |
TransformPoint(double[] argout,
int bDstToSrc,
double x,
double y)
Transform a 2D point.
|
int |
TransformPoint(double[] argout,
int bDstToSrc,
double x,
double y,
double z)
Transform a 3D point.
|
int |
TransformPoint(int bDstToSrc,
double[] inout)
Transform a 3D point.
|
int |
TransformPoints(int bDstToSrc,
double[][] arrayOfCoords,
int[] panSuccess)
Transform an array of coordinates.
|
public Transformer(Dataset src_ds, Dataset dst_ds, Vector options)
This function creates a transformation object that maps from pixel/line coordinates on one image to pixel/line coordinates on another image. The images may potentially be georeferenced in different coordinate systems, and may used GCPs to map between their pixel/line coordinates and georeferenced coordinates (as opposed to the default assumption that their geotransform should be used).
This transformer potentially performs three concatenated transformations.
The first stage is from source image pixel/line coordinates to source image georeferenced coordinates, and may be done using the geotransform, or if not defined using a polynomial model derived from GCPs. If GCPs are used this stage is accomplished using GDALGCPTransform().
The second stage is to change projections from the source coordinate system to the destination coordinate system, assuming they differ. This is accomplished internally using GDALReprojectionTransform().
The third stage is converting from destination image georeferenced coordinates to destination image coordinates. This is done using the destination image geotransform, or if not available, using a polynomial model derived from GCPs. If GCPs are used this stage is accomplished using GDALGCPTransform(). This stage is skipped if dst_ds is null when the transformation is created. Supported Options:
src_ds
- source dataset, or null.dst_ds
- destination dataset (or null).options
- options provides as a vector of strings of the format "NAME=VALUE" (or null)public void delete()
public int TransformPoint(int bDstToSrc, double[] inout)
The method will use the provided 3 double values and update them.
inout
- array of 3 double values (x, y, z) used for input and output.bDstToSrc
- 1 for inverse transformation, 0 for forward transformation.public int TransformPoint(double[] argout, int bDstToSrc, double x, double y, double z)
The method will use the provided (x, y, z) values and put the transformed values into argout
argout
- array of 3 double values where the transformed coordinates will be put.bDstToSrc
- 1 for inverse transformation, 0 for forward transformation.x
- input x valuey
- input y valuez
- input z valuepublic int TransformPoint(double[] argout, int bDstToSrc, double x, double y)
The method will use the provided (x, y) values and put the transformed values into argout
argout
- array of 3 double values where the transformed coordinates will be put.bDstToSrc
- 1 for inverse transformation, 0 for forward transformation.x
- input x valuey
- input y valuepublic int TransformPoints(int bDstToSrc, double[][] arrayOfCoords, int[] panSuccess)
The method will use the provided array of values and put the update coordinates into it.
arrayOfCoords
- array of 2D or 3D values.bDstToSrc
- 1 for inverse transformation, 0 for forward transformation.panSuccess
- array where to put the success flag for each transformation.
May be null, otherwise panSuccess.length must be equal to arrayOfCoords.lengthpublic int TransformGeolocations(Band xBand, Band yBand, Band zBand, ProgressCallback callback, Vector options)
public int TransformGeolocations(Band xBand, Band yBand, Band zBand, ProgressCallback callback)