Package org.meteoinfo.projection.proj4j
Class BasicCoordinateTransform
- java.lang.Object
-
- org.meteoinfo.projection.proj4j.BasicCoordinateTransform
-
- All Implemented Interfaces:
CoordinateTransform
public class BasicCoordinateTransform extends java.lang.Object implements CoordinateTransform
Represents the operation of transforming aProjCoordinatefrom oneCoordinateReferenceSysteminto a different one, using reprojection and datum conversion as required.Computing the transform involves the following steps:
- If the source coordinate is in a projected coordinate system, it is inverse-projected into a geographic coordinate system based on the source datum
- If the source and target
Datums are different, the source geographic coordinate is converted from the source to the target datum as accurately as possible - If the target coordinate system is a projected coordinate system, the converted geographic coordinate is projected into a projected coordinate.
[ SrcProjCRS {InverseProjection} ] SrcGeoCRS [ {Datum Conversion} ] TgtGeoCRS [ {Projection} TgtProjCRS ]BasicCoordinateTransform objects are stateful, and thus are not thread-safe. However, they may be reused any number of times within a single thread.Information about the transformation procedure is pre-computed and cached in this object for efficient computation.
- See Also:
CoordinateTransformFactory
-
-
Constructor Summary
Constructors Constructor Description BasicCoordinateTransform(CoordinateReferenceSystem srcCRS, CoordinateReferenceSystem tgtCRS)Creates a transformation from a sourceCoordinateReferenceSystemto a target one.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CoordinateReferenceSystemgetSourceCRS()CoordinateReferenceSystemgetTargetCRS()ProjCoordinatetransform(ProjCoordinate src, ProjCoordinate tgt)Tranforms a coordinate from the sourceCoordinateReferenceSystemto the target one.
-
-
-
Constructor Detail
-
BasicCoordinateTransform
public BasicCoordinateTransform(CoordinateReferenceSystem srcCRS, CoordinateReferenceSystem tgtCRS)
Creates a transformation from a sourceCoordinateReferenceSystemto a target one.- Parameters:
srcCRS- the source CRS to transform fromtgtCRS- the target CRS to transform to
-
-
Method Detail
-
getSourceCRS
public CoordinateReferenceSystem getSourceCRS()
- Specified by:
getSourceCRSin interfaceCoordinateTransform
-
getTargetCRS
public CoordinateReferenceSystem getTargetCRS()
- Specified by:
getTargetCRSin interfaceCoordinateTransform
-
transform
public ProjCoordinate transform(ProjCoordinate src, ProjCoordinate tgt) throws Proj4jException
Tranforms a coordinate from the sourceCoordinateReferenceSystemto the target one.- Specified by:
transformin interfaceCoordinateTransform- Parameters:
src- the input coordinate to be transformedtgt- the transformed coordinate- Returns:
- the target coordinate which was passed in
- Throws:
Proj4jException- if a computation error is encountered
-
-