Class TransformWrapper
java.lang.Object
org.locationtech.proj4j.geoapi.Wrapper
org.locationtech.proj4j.geoapi.TransformWrapper
- All Implemented Interfaces:
Serializable, org.opengis.metadata.Identifier, org.opengis.referencing.IdentifiedObject, org.opengis.referencing.operation.CoordinateOperation, org.opengis.referencing.operation.MathTransform, org.opengis.referencing.ReferenceIdentifier
- Direct Known Subclasses:
TransformWrapper2D, TransformWrapper3D
abstract class TransformWrapper
extends Wrapper
implements org.opengis.referencing.operation.CoordinateOperation, org.opengis.referencing.operation.MathTransform, Serializable
Base class of two-dimensional or three-dimensional coordinate operation.
The exact type of the operation (conversion, transformation or concatenated) is unknown.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final CoordinateTransformThe wrapped PROJ4 implementation.Fields inherited from class Wrapper
BIDIMENSIONAL, TRIDIMENSIONALFields inherited from interface org.opengis.referencing.operation.CoordinateOperation
COORDINATE_OPERATION_ACCURACY_KEY, DOMAIN_OF_VALIDITY_KEY, OPERATION_VERSION_KEY, SCOPE_KEYFields inherited from interface org.opengis.referencing.IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEYFields inherited from interface org.opengis.metadata.Identifier
AUTHORITY_KEY, CODE_KEYFields inherited from interface org.opengis.referencing.ReferenceIdentifier
CODESPACE_KEY, VERSION_KEY -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new wrapper for the given PROJ4J implementation. -
Method Summary
Modifier and TypeMethodDescription(package private) static org.opengis.referencing.operation.TransformExceptionWraps the given PROJ4J exception in a GeoAPI exception.(package private) static voidcheckNumPts(int numPts) validates the number of points argument.org.opengis.referencing.operation.Matrixderivative(org.opengis.geometry.DirectPosition point) Unsupported operation.getCode()Returns a name that summarizes the operation.Collection<org.opengis.metadata.quality.PositionalAccuracy> Returns the impact of this operation on point accuracy.final org.opengis.referencing.operation.MathTransformReturns the object performing the actual coordinate operations.private static StringReturns the name of the given CRS, or an arbitrary name if none is specified.Returns the version of the coordinate transformation.private static ProjectionReturns the projection of the given CRS, ornullif none.final org.opengis.referencing.crs.CoordinateReferenceSystemReturns the CRS of the source points.final org.opengis.referencing.crs.CoordinateReferenceSystemReturns the CRS of the target points.(package private) final ObjectReturns the PROJ4J backing implementation.final booleanTests whether this transform does not move any points.final org.opengis.geometry.DirectPositiontransform(org.opengis.geometry.DirectPosition ptSrc, org.opengis.geometry.DirectPosition ptDst) Transforms the specifiedptSrcand stores the result inptDst.(package private) static TransformWrapperwrap(CoordinateTransform impl, boolean is3D) Wraps the given implementation.Methods inherited from class Wrapper
equals, getAlias, getAuthority, getCodeSpace, getDomainOfValidity, getIdentifiers, getName, getRemarks, getScope, getVersion, hashCode, toString, toWKTMethods inherited from interface org.opengis.referencing.operation.CoordinateOperation
getDomainOfValidity, getScopeMethods inherited from interface org.opengis.referencing.IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKTMethods inherited from interface org.opengis.referencing.operation.MathTransform
getSourceDimensions, getTargetDimensions, inverse, toWKT, transform, transform, transform, transform
-
Field Details
-
impl
The wrapped PROJ4 implementation.
-
-
Constructor Details
-
TransformWrapper
TransformWrapper(CoordinateTransform impl) Creates a new wrapper for the given PROJ4J implementation.
-
-
Method Details
-
wrap
Wraps the given implementation.- Parameters:
impl- the implementation to wrap, ornullis3D- whether to return a three-dimensional operation instead of a two-dimensional one- Returns:
- the wrapper, or
nullif the given implementation was null
-
implementation
Returns the PROJ4J backing implementation..- Specified by:
implementationin classWrapper- Returns:
- the PROJ4J backing implementation
-
getProjection
Returns the projection of the given CRS, ornullif none. -
getName
Returns the name of the given CRS, or an arbitrary name if none is specified. -
getCode
-
getSourceCRS
public final org.opengis.referencing.crs.CoordinateReferenceSystem getSourceCRS()Returns the CRS of the source points.. May benullif unspecified.- Specified by:
getSourceCRSin interfaceorg.opengis.referencing.operation.CoordinateOperation- Returns:
- the CRS of the source points
-
getTargetCRS
public final org.opengis.referencing.crs.CoordinateReferenceSystem getTargetCRS()Returns the CRS of the target points.. May benullif unspecified.- Specified by:
getTargetCRSin interfaceorg.opengis.referencing.operation.CoordinateOperation- Returns:
- the CRS of the target points
-
getOperationVersion
Returns the version of the coordinate transformation.. This is unknown by default.- Specified by:
getOperationVersionin interfaceorg.opengis.referencing.operation.CoordinateOperation- Returns:
- the version of the coordinate transformation
-
getCoordinateOperationAccuracy
Returns the impact of this operation on point accuracy.. This is unknown by default.- Specified by:
getCoordinateOperationAccuracyin interfaceorg.opengis.referencing.operation.CoordinateOperation- Returns:
- the impact of this operation on point accuracy
-
getMathTransform
public final org.opengis.referencing.operation.MathTransform getMathTransform()Returns the object performing the actual coordinate operations.. This is the same object in the case of PROJ4J implementation.- Specified by:
getMathTransformin interfaceorg.opengis.referencing.operation.CoordinateOperation- Returns:
- the object performing the actual coordinate operations
-
isIdentity
public final boolean isIdentity()Tests whether this transform does not move any points.- Specified by:
isIdentityin interfaceorg.opengis.referencing.operation.MathTransform
-
transform
public final org.opengis.geometry.DirectPosition transform(org.opengis.geometry.DirectPosition ptSrc, org.opengis.geometry.DirectPosition ptDst) throws org.opengis.referencing.operation.TransformException Transforms the specifiedptSrcand stores the result inptDst. If the target position is a wrapper, this method writes the result directly in the backing implementation. This method has some flexibility on the number of dimensions (2 or 3).- Specified by:
transformin interfaceorg.opengis.referencing.operation.MathTransform- Throws:
org.opengis.referencing.operation.TransformException
-
derivative
public org.opengis.referencing.operation.Matrix derivative(org.opengis.geometry.DirectPosition point) throws org.opengis.referencing.operation.TransformException Unsupported operation.- Specified by:
derivativein interfaceorg.opengis.referencing.operation.MathTransform- Throws:
org.opengis.referencing.operation.TransformException
-
checkNumPts
static void checkNumPts(int numPts) validates the number of points argument. -
cannotTransform
Wraps the given PROJ4J exception in a GeoAPI exception.- Parameters:
e- the PROJ4J exception- Returns:
- the GeoAPI exception
-