public class CoordinateTransformation
extends java.lang.Object
The CoordinateTransformation class is a binding for the C++ OGRCoordinateTransformation class.
Constructor | Description |
---|---|
CoordinateTransformation(SpatialReference src,
SpatialReference dst) |
Deprecated.
|
CoordinateTransformation(SpatialReference src,
SpatialReference dst,
CoordinateTransformationOptions options) |
Modifier and Type | Method | Description |
---|---|---|
static CoordinateTransformation |
CreateCoordinateTransformation(SpatialReference src,
SpatialReference dst) |
Create transformation object.
|
void |
delete() |
|
void |
TransformPoint(double[] inout) |
Transform point from source to destination space.
|
void |
TransformPoint(double[] argout,
double x,
double y) |
Transform point from source to destination space.
|
void |
TransformPoint(double[] argout,
double x,
double y,
double z) |
Transform point from source to destination space.
|
void |
TransformPoint(double[] argout,
double x,
double y,
double z,
double t) |
|
double[] |
TransformPoint(double x,
double y) |
Transform point from source to destination space.
|
double[] |
TransformPoint(double x,
double y,
double z) |
Transform point from source to destination space.
|
void |
TransformPoints(double[][] pointArray) |
Transform points from source to destination space.
|
int[] |
TransformPointsWithErrorCodes(double[][] pointArray) |
Transform points from source to destination space.
|
public CoordinateTransformation(SpatialReference src, SpatialReference dst)
Caution: the coordinate transformation object returned can be in a non working state if no coordinate transformation can be established between src and dst, and calling other methods on it can result in the process termination. If using GDAL 1.10 or above, it is recommended to use the CreateCoordinateTransformation(org.gdal.osr.SpatialReference, org.gdal.osr.SpatialReference) method instead.
For GDAL 1.9.X or below, you might use the following snippet :
gdal.PushErrorHandler( "CPLQuietErrorHandler" ); hTransform = new CoordinateTransformation(src, dst); gdal.PopErrorHandler(); if (gdal.GetLastErrorMsg().indexOf("Unable to load PROJ.4 library") != -1) hTransform = null;
src
- source spatial reference system.dst
- target spatial reference system.CreateCoordinateTransformation(org.gdal.osr.SpatialReference, org.gdal.osr.SpatialReference)
public CoordinateTransformation(SpatialReference src, SpatialReference dst, CoordinateTransformationOptions options)
public void delete()
public double[] TransformPoint(double x, double y, double z)
x
- input x valuey
- input y valuepublic double[] TransformPoint(double x, double y)
x
- input x valuey
- input y valuepublic static CoordinateTransformation CreateCoordinateTransformation(SpatialReference src, SpatialReference dst)
src
- source spatial reference system.dst
- target spatial reference system.public void TransformPoint(double[] inout)
The provided array will be modified in place.
inout
- an array of 3 doublespublic void TransformPoint(double[] argout, double x, double y, double z)
argout
- array of 3 double values where the transformed coordinates will be put.x
- input x valuey
- input y valuez
- input z valuepublic void TransformPoint(double[] argout, double x, double y)
argout
- array of 3 double values where the transformed coordinates will be put.x
- input x valuey
- input y valuepublic void TransformPoint(double[] argout, double x, double y, double z, double t)
public void TransformPoints(double[][] pointArray)
The provided array will be modified in place.
pointArray
- an array of coordinates. Each coordinate can be either 2D, 3D or 4Dpublic int[] TransformPointsWithErrorCodes(double[][] pointArray)
The provided array will be modified in place.
pointArray
- an array of coordinates. Each coordinate can be either 2D, 3D or 4D