public class CoordinateTransformation extends Object
The CoordinateTransformation class is a binding for the C++ OGRCoordinateTransformation class.
Constructor and Description |
---|
CoordinateTransformation(SpatialReference src,
SpatialReference dst)
Deprecated.
|
Modifier and Type | Method and 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.
|
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.
|
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 recommanded 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 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 TransformPoints(double[][] pointArray)
The provided array will be modified in place.
pointArray
- an array of coordinates. Each coordinate can be either 2D or 3D