Class SimpleTransform

    • Constructor Detail

    • Method Detail

      • getSourceDimensions

        public int getSourceDimensions()
        Gets the dimension of input points. The default implementation returns the dimension of the source CRS.
        Specified by:
        getSourceDimensions in interface MathTransform
        Returns:
        the dimension of input points.
      • getTargetDimensions

        public int getTargetDimensions()
        Gets the dimension of target points. The default implementation returns the dimension of the target CRS.
        Specified by:
        getTargetDimensions in interface MathTransform
        Returns:
        the dimension of input points.
      • getMathTransform

        public MathTransform getMathTransform()
        Gets the math transform, which is represented directly by this implementation class since it does not distinguish operation and transform.
        Specified by:
        getMathTransform in interface CoordinateOperation
        Returns:
        the transform from source to target CRS.
      • transform

        public abstract DirectPosition transform​(DirectPosition ptSrc,
                                                 DirectPosition ptDst)
                                          throws MismatchedDimensionException,
                                                 TransformException
        Transforms the specified ptSrc and stores the result in ptDst. If ptDst is null, a new DirectPosition object is allocated and the result of the transformation is stored in this object. In either case, ptDst, which contains the transformed point, is returned for convenience. If ptSrc and ptDst are the same object, the input point is correctly overwritten with the transformed point.
        Specified by:
        transform in interface MathTransform
        Parameters:
        ptSrc - the specified coordinate point to be transformed.
        ptDst - the specified coordinate point that stores the result of transforming ptSrc, or null.
        Returns:
        the coordinate point after transforming ptSrc and storing the result in ptDst, or a newly created point if ptDst was null.
        Throws:
        MismatchedDimensionException - if ptSrc or ptDst does not have the expected dimension.
        TransformException - if the point can not be transformed.
      • transform

        public void transform​(double[] srcPts,
                              int srcOff,
                              double[] dstPts,
                              int dstOff,
                              int numPts)
                       throws TransformException
        Transforms a list of coordinate point ordinal values.
        Specified by:
        transform in interface MathTransform
        Parameters:
        srcPts - the array containing the source point coordinates.
        srcOff - the offset to the first point to be transformed in the source array.
        dstPts - the array into which the transformed point coordinates are returned. May be the same than srcPts.
        dstOff - the offset to the location of the first transformed point that is stored in the destination array.
        numPts - the number of point objects to be transformed.
        Throws:
        TransformException - if a point can not be transformed.
      • transform

        public void transform​(float[] srcPts,
                              int srcOff,
                              float[] dstPts,
                              int dstOff,
                              int numPts)
                       throws TransformException
        Transforms a list of coordinate point ordinal values.
        Specified by:
        transform in interface MathTransform
        Parameters:
        srcPts - the array containing the source point coordinates.
        srcOff - the offset to the first point to be transformed in the source array.
        dstPts - the array into which the transformed point coordinates are returned. May be the same than srcPts.
        dstOff - the offset to the location of the first transformed point that is stored in the destination array.
        numPts - the number of point objects to be transformed.
        Throws:
        TransformException - if a point can not be transformed.
      • transform

        public void transform​(float[] srcPts,
                              int srcOff,
                              double[] dstPts,
                              int dstOff,
                              int numPts)
                       throws TransformException
        Transforms a list of coordinate point ordinal values.
        Specified by:
        transform in interface MathTransform
        Parameters:
        srcPts - the array containing the source point coordinates.
        srcOff - the offset to the first point to be transformed in the source array.
        dstPts - the array into which the transformed point coordinates are returned. May be the same than srcPts.
        dstOff - the offset to the location of the first transformed point that is stored in the destination array.
        numPts - the number of point objects to be transformed.
        Throws:
        TransformException - if a point can not be transformed.
      • transform

        public void transform​(double[] srcPts,
                              int srcOff,
                              float[] dstPts,
                              int dstOff,
                              int numPts)
                       throws TransformException
        Transforms a list of coordinate point ordinal values.
        Specified by:
        transform in interface MathTransform
        Parameters:
        srcPts - the array containing the source point coordinates.
        srcOff - the offset to the first point to be transformed in the source array.
        dstPts - the array into which the transformed point coordinates are returned. May be the same than srcPts.
        dstOff - the offset to the location of the first transformed point that is stored in the destination array.
        numPts - the number of point objects to be transformed.
        Throws:
        TransformException - if a point can not be transformed.
      • derivative

        public Matrix derivative​(DirectPosition point)
                          throws TransformException
        Gets the derivative of this transform at a point. The default implementation throws an exception in all cases.
        Specified by:
        derivative in interface MathTransform
        Parameters:
        point - the coordinate point where to evaluate the derivative.
        Returns:
        the derivative at the specified point (never null).
        Throws:
        TransformException - if the derivative can not be evaluated at the specified point.
      • isIdentity

        public boolean isIdentity()
        Tests whether this transform does not move any points. The default implementation tests if the source and target CRS are equals.
        Specified by:
        isIdentity in interface MathTransform
        Returns:
        true if this MathTransform is an identity transform; false otherwise.
      • getOperationVersion

        public String getOperationVersion()
        Version of the coordinate transformation (i.e., instantiation due to the stochastic nature of the parameters). The default implementation returns null.
        Specified by:
        getOperationVersion in interface CoordinateOperation
        Returns:
        the coordinate operation version, or null in none.
      • equals

        public boolean equals​(Object object)
        Compares this transform with the given object for equality.
        Overrides:
        equals in class SimpleIdentifiedObject
        Parameters:
        object - the object to compare with this SimpleTransform.
        Returns:
        true if the given object is equals to this object.