Package org.gdal.gdal

## Class Transformer

- java.lang.Object
- - org.gdal.gdal.Transformer

-     public class Transformer
      extends java.lang.Object

  Class used for image to image transformer.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Transformer​(Dataset src_ds, Dataset dst_ds, java.util.Vector options)` | Create image to image transformer.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `delete()` |
    `boolean` | `equals​(java.lang.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, java.util.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.

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Transformer

          public Transformer​(Dataset src_ds,
                             Dataset dst_ds,
                             java.util.Vector options)

      Create image to image transformer.

      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_SRS: WKT SRS to be used as an override for src_ds.
      - DST_SRS: WKT SRS to be used as an override for dst_ds.
      - GCPS_OK: If FALSE, GCPs will not be used, default is TRUE.
      - MAX_GCP_ORDER: the maximum order to use for GCP derived polynomials if possible. The default is to autoselect based on the number of GCPs. A value of -1 triggers use of Thin Plate Spline instead of polynomials.
      - METHOD: may have a value which is one of GEOTRANSFORM, GCP_POLYNOMIAL, GCP_TPS, GEOLOC_ARRAY, RPC to force only one geolocation method to be considered on the source dataset.
      - RPC_HEIGHT: A fixed height to be used with RPC calculations.
      - RPC_DEM: The name of a DEM file to be used with RPC calculations.
      Parameters:
        `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)

  - ### Method Detail

    - #### delete

          public void delete()

    - #### equals

          public boolean equals​(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### TransformPoint

          public int TransformPoint​(int bDstToSrc,
                                    double[] inout)

      Transform a 3D point.

      The method will use the provided 3 double values and update them.

      Parameters:
        `inout` - array of 3 double values (x, y, z) used for input and output.
        `bDstToSrc` - 1 for inverse transformation, 0 for forward transformation.
      Returns:
        1 on success, 0 otherwise

    - #### TransformPoint

          public int TransformPoint​(double[] argout,
                                    int bDstToSrc,
                                    double x,
                                    double y,
                                    double z)

      Transform a 3D point.

      The method will use the provided (x, y, z) values and put the transformed values into argout

      Parameters:
        `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 value
        `y` - input y value
        `z` - input z value
      Returns:
        1 on success, 0 otherwise

    - #### TransformPoint

          public int TransformPoint​(double[] argout,
                                    int bDstToSrc,
                                    double x,
                                    double y)

      Transform a 2D point.

      The method will use the provided (x, y) values and put the transformed values into argout

      Parameters:
        `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 value
        `y` - input y value
      Returns:
        1 on success, 0 otherwise
      Since:
        Java bindings 1.7.0

    - #### TransformPoints

          public int TransformPoints​(int bDstToSrc,
                                     double[][] arrayOfCoords,
                                     int[] panSuccess)

      Transform an array of coordinates.

      The method will use the provided array of values and put the update coordinates into it.

      Parameters:
        `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.length
      Returns:
        1 on success, 0 otherwise
      Since:
        Java bindings 1.7.0

    - #### TransformGeolocations

          public int TransformGeolocations​(Band xBand,
                                           Band yBand,
                                           Band zBand,
                                           ProgressCallback callback,
                                           java.util.Vector options)

    - #### TransformGeolocations

          public int TransformGeolocations​(Band xBand,
                                           Band yBand,
                                           Band zBand,
                                           ProgressCallback callback)

    - #### TransformGeolocations

          public int TransformGeolocations​(Band xBand,
                                           Band yBand,
                                           Band zBand)