Package org.locationtech.proj4j.geoapi
Class TransformWrapper2D
- java.lang.Object
-
- org.locationtech.proj4j.geoapi.Wrapper
-
- org.locationtech.proj4j.geoapi.TransformWrapper
-
- org.locationtech.proj4j.geoapi.TransformWrapper2D
-
- All Implemented Interfaces:
java.io.Serializable,org.opengis.metadata.Identifier,org.opengis.referencing.IdentifiedObject,org.opengis.referencing.operation.CoordinateOperation,org.opengis.referencing.operation.MathTransform,org.opengis.referencing.operation.MathTransform2D,org.opengis.referencing.ReferenceIdentifier
- Direct Known Subclasses:
ProjectionWrapper2D
class TransformWrapper2D extends TransformWrapper implements org.opengis.referencing.operation.MathTransform2D
Wraps a PROJ4J transform behind the equivalent GeoAPI interface for the two-dimensional case. The exact type of the operation (conversion, transformation or concatenated) is unknown.
-
-
Field Summary
Fields Modifier and Type Field Description private TransformWrapper2DinverseThe inverse of this wrapper, computed when first requested.-
Fields inherited from class org.locationtech.proj4j.geoapi.TransformWrapper
impl
-
Fields inherited from class org.locationtech.proj4j.geoapi.Wrapper
BIDIMENSIONAL, TRIDIMENSIONAL
-
Fields inherited from interface org.opengis.referencing.operation.CoordinateOperation
COORDINATE_OPERATION_ACCURACY_KEY, DOMAIN_OF_VALIDITY_KEY, OPERATION_VERSION_KEY, SCOPE_KEY
-
-
Constructor Summary
Constructors Constructor Description TransformWrapper2D(CoordinateTransform impl)Creates a new wrapper for the given PROJ4J implementation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.ShapecreateTransformedShape(java.awt.Shape shape)Transforms the given shape.org.opengis.referencing.operation.Matrixderivative(java.awt.geom.Point2D point)Unsupported operation.intgetSourceDimensions(){@return the number of dimensions of input coordinates, which is 2}.intgetTargetDimensions(){@return the number of dimensions of output coordinates, which is 2}.org.opengis.referencing.operation.MathTransform2Dinverse(){@return the inverse of this coordinate operation}.voidtransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)Transforms coordinate tuples in the given arrays in double precision.voidtransform(double[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)Transforms coordinate tuples in the given arrays, with target coordinates converted to single precision.voidtransform(float[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)Transforms coordinate tuples in the given arrays, with source coordinates converted from single precision.voidtransform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)Transforms coordinate tuples in the given arrays in single precision.java.awt.geom.Point2Dtransform(java.awt.geom.Point2D ptSrc, java.awt.geom.Point2D ptDst)Transforms the specifiedptSrcand stores the result inptDst.-
Methods inherited from class org.locationtech.proj4j.geoapi.TransformWrapper
cannotTransform, checkNumPts, derivative, getCode, getCoordinateOperationAccuracy, getMathTransform, getOperationVersion, getSourceCRS, getTargetCRS, implementation, isIdentity, transform, wrap
-
Methods inherited from class org.locationtech.proj4j.geoapi.Wrapper
equals, getAlias, getAuthority, getCodeSpace, getDomainOfValidity, getIdentifiers, getName, getRemarks, getScope, getVersion, hashCode, toString, toWKT
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opengis.referencing.operation.CoordinateOperation
getDomainOfValidity, getScope
-
-
-
-
Field Detail
-
inverse
private transient TransformWrapper2D inverse
The inverse of this wrapper, computed when first requested.- See Also:
inverse()
-
-
Constructor Detail
-
TransformWrapper2D
TransformWrapper2D(CoordinateTransform impl)
Creates a new wrapper for the given PROJ4J implementation.
-
-
Method Detail
-
getSourceDimensions
public final int getSourceDimensions()
{@return the number of dimensions of input coordinates, which is 2}. This number of dimensions is implied by theMathTransform2Dinterface implemented by this class.- Specified by:
getSourceDimensionsin interfaceorg.opengis.referencing.operation.MathTransform
-
getTargetDimensions
public final int getTargetDimensions()
{@return the number of dimensions of output coordinates, which is 2}. This number of dimensions is implied by theMathTransform2Dinterface implemented by this class.- Specified by:
getTargetDimensionsin interfaceorg.opengis.referencing.operation.MathTransform
-
transform
public java.awt.geom.Point2D transform(java.awt.geom.Point2D ptSrc, java.awt.geom.Point2D ptDst) throws org.opengis.referencing.operation.TransformExceptionTransforms the specifiedptSrcand stores the result inptDst.- Specified by:
transformin interfaceorg.opengis.referencing.operation.MathTransform2D- Throws:
org.opengis.referencing.operation.TransformException
-
transform
public void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws org.opengis.referencing.operation.TransformExceptionTransforms coordinate tuples in the given arrays in double precision. This is the most frequently used method.- Specified by:
transformin interfaceorg.opengis.referencing.operation.MathTransform- Throws:
org.opengis.referencing.operation.TransformException
-
transform
public void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) throws org.opengis.referencing.operation.TransformExceptionTransforms coordinate tuples in the given arrays in single precision. This is a copy of the double-precision variant of this method with only cast added.- Specified by:
transformin interfaceorg.opengis.referencing.operation.MathTransform- Throws:
org.opengis.referencing.operation.TransformException
-
transform
public void transform(float[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws org.opengis.referencing.operation.TransformExceptionTransforms coordinate tuples in the given arrays, with source coordinates converted from single precision.- Specified by:
transformin interfaceorg.opengis.referencing.operation.MathTransform- Throws:
org.opengis.referencing.operation.TransformException
-
transform
public void transform(double[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) throws org.opengis.referencing.operation.TransformExceptionTransforms coordinate tuples in the given arrays, with target coordinates converted to single precision.- Specified by:
transformin interfaceorg.opengis.referencing.operation.MathTransform- Throws:
org.opengis.referencing.operation.TransformException
-
createTransformedShape
public java.awt.Shape createTransformedShape(java.awt.Shape shape) throws org.opengis.referencing.operation.TransformExceptionTransforms the given shape. This simple implementation transforms the control points. It does not check if some straight lines should be converted to curves.- Specified by:
createTransformedShapein interfaceorg.opengis.referencing.operation.MathTransform2D- Throws:
org.opengis.referencing.operation.TransformException
-
derivative
public org.opengis.referencing.operation.Matrix derivative(java.awt.geom.Point2D point) throws org.opengis.referencing.operation.TransformExceptionUnsupported operation.- Specified by:
derivativein interfaceorg.opengis.referencing.operation.MathTransform2D- Throws:
org.opengis.referencing.operation.TransformException
-
inverse
public org.opengis.referencing.operation.MathTransform2D inverse()
{@return the inverse of this coordinate operation}.- Specified by:
inversein interfaceorg.opengis.referencing.operation.MathTransform- Specified by:
inversein interfaceorg.opengis.referencing.operation.MathTransform2D
-
-