Package org.gdal.osr

Class CoordinateTransformation

java.lang.Object
org.gdal.osr.CoordinateTransformation

public class CoordinateTransformation extends Object
Object for transforming between coordinate systems.

The CoordinateTransformation class is a binding for the C++ OGRCoordinateTransformation class.

  • Constructor Details

  • Method Details

    • delete

      public void delete()
    • TransformPoint

      public double[] TransformPoint(double x, double y, double z)
      Transform point from source to destination space.
      Parameters:
      x - input x value
      y - input y value
      Returns:
      the transformed coordinates
      Since:
      Java bindings 1.7.0
    • TransformPoint

      public double[] TransformPoint(double x, double y)
      Transform point from source to destination space.
      Parameters:
      x - input x value
      y - input y value
      Returns:
      the transformed coordinates
      Since:
      Java bindings 1.7.0
    • CreateCoordinateTransformation

      public static CoordinateTransformation CreateCoordinateTransformation(SpatialReference src, SpatialReference dst)
      Create transformation object.
      Parameters:
      src - source spatial reference system.
      dst - target spatial reference system.
      Returns:
      a new CoordinateTransformation object, or null in case of failure
      Since:
      GDAL 1.10
    • CreateCoordinateTransformation

      public static CoordinateTransformation CreateCoordinateTransformation(SpatialReference src, SpatialReference dst, CoordinateTransformationOptions options)
    • GetInverse

      public CoordinateTransformation GetInverse()
    • TransformPoint

      public void TransformPoint(double[] inout)
      Transform point from source to destination space.

      The provided array will be modified in place.

      Parameters:
      inout - an array of 3 doubles
    • TransformPoint

      public void TransformPoint(double[] argout, double x, double y, double z)
      Transform point from source to destination space.
      Parameters:
      argout - array of 3 double values where the transformed coordinates will be put.
      x - input x value
      y - input y value
      z - input z value
    • TransformPoint

      public void TransformPoint(double[] argout, double x, double y)
      Transform point from source to destination space.
      Parameters:
      argout - array of 3 double values where the transformed coordinates will be put.
      x - input x value
      y - input y value
      Since:
      Java bindings 1.7.0
    • TransformPoint

      public void TransformPoint(double[] argout, double x, double y, double z, double t)
    • TransformPointWithErrorCode

      public int TransformPointWithErrorCode(double[] argout, double x, double y, double z, double t)
      Transform point from source to destination space.
      Parameters:
      argout - array of 4 double values where the transformed coordinates will be put.
      x - input x value
      y - input y value
      z - input z value
      t - input t value
      Returns:
      the error code. 0 means no error. See osrConstants.PROJ_ERR_xxxxx enumerated code for the possible error codes.
      Since:
      GDAL 3.3 and PROJ 8
    • TransformPoints

      public void TransformPoints(double[][] pointArray)
      Transform points from source to destination space.

      The provided array will be modified in place.

      Parameters:
      pointArray - an array of coordinates. Each coordinate can be either 2D, 3D or 4D
    • TransformPointsWithErrorCodes

      public int[] TransformPointsWithErrorCodes(double[][] pointArray)
      Transform points from source to destination space.

      The provided array will be modified in place.

      Parameters:
      pointArray - an array of coordinates. Each coordinate can be either 2D, 3D or 4D
      Returns:
      an array of integer with the error codes for each coordinate. 0 means no error. See osrConstants.PROJ_ERR_xxxxx enumerated code for the possible error codes.
      Since:
      GDAL 3.3 and PROJ 8
    • TransformBounds

      public void TransformBounds(double[] argout, double minx, double miny, double maxx, double maxy, int densify_pts)