Interface MathTransform

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Matrix derivative​(Position point)
      Gets the derivative of this transform at a point.
      int getSourceDimensions()
      Gets the dimension of input points.
      int getTargetDimensions()
      Gets the dimension of output points.
      MathTransform inverse()
      Creates the inverse transform of this object.
      boolean isIdentity()
      Tests whether this transform does not move any points.
      String toWKT()
      Returns a Well Known Text (WKT) for this object.
      void transform​(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
      Transforms a list of coordinate point ordinal values.
      void transform​(double[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
      Transforms a list of coordinate point ordinal values.
      void transform​(float[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
      Transforms a list of coordinate point ordinal values.
      void transform​(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
      Transforms a list of coordinate point ordinal values.
      Position transform​(Position ptSrc, Position ptDst)
      Transforms the specified ptSrc and stores the result in ptDst.
    • Method Detail

      • getSourceDimensions

        int getSourceDimensions()
        Gets the dimension of input points.
        Returns:
        The dimension of input points.
      • getTargetDimensions

        int getTargetDimensions()
        Gets the dimension of output points.
        Returns:
        The dimension of output points.
      • transform

        Position transform​(Position ptSrc,
                           Position ptDst)
                    throws MismatchedDimensionException,
                           TransformException
        Transforms the specified ptSrc and stores the result in ptDst. If ptDst is null, a new Position object is allocated and then 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.
        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 doesn't have the expected dimension.
        TransformException - if the point can't be transformed.
      • transform

        void transform​(double[] srcPts,
                       int srcOff,
                       double[] dstPts,
                       int dstOff,
                       int numPts)
                throws TransformException
        Transforms a list of coordinate point ordinal values. This method is provided for efficiently transforming many points. The supplied array of ordinal values will contain packed ordinal values. For example, if the source dimension is 3, then the ordinals will be packed in this order:

        (x0,y0,z0, x1,y1,z1 ...).

        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't be transformed. Some implementations will stop at the first failure, wile some other implementations will fill the untransformable points with NaN values, continue and throw the exception only at end. Implementations that fall in the later case should set the last completed transform to this.
      • transform

        void transform​(float[] srcPts,
                       int srcOff,
                       float[] dstPts,
                       int dstOff,
                       int numPts)
                throws TransformException
        Transforms a list of coordinate point ordinal values. This method is provided for efficiently transforming many points. The supplied array of ordinal values will contain packed ordinal values. For example, if the source dimension is 3, then the ordinals will be packed in this order:

        (x0,y0,z0, x1,y1,z1 ...).

        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't be transformed. Some implementations will stop at the first failure, wile some other implementations will fill the untransformable points with NaN values, continue and throw the exception only at end. Implementations that fall in the later case should set the last completed transform to this.
      • transform

        void transform​(float[] srcPts,
                       int srcOff,
                       double[] dstPts,
                       int dstOff,
                       int numPts)
                throws TransformException
        Transforms a list of coordinate point ordinal values. This method is provided for efficiently transforming many points. The supplied array of ordinal values will contain packed ordinal values. For example, if the source dimension is 3, then the ordinals will be packed in this order:

        (x0,y0,z0, x1,y1,z1 ...).

        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.
        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't be transformed. Some implementations will stop at the first failure, wile some other implementations will fill the untransformable points with NaN values, continue and throw the exception only at end. Implementations that fall in the later case should set the last completed transform to this.
        Since:
        GeoAPI 2.2
      • transform

        void transform​(double[] srcPts,
                       int srcOff,
                       float[] dstPts,
                       int dstOff,
                       int numPts)
                throws TransformException
        Transforms a list of coordinate point ordinal values. This method is provided for efficiently transforming many points. The supplied array of ordinal values will contain packed ordinal values. For example, if the source dimension is 3, then the ordinals will be packed in this order:

        (x0,y0,z0, x1,y1,z1 ...).

        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.
        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't be transformed. Some implementations will stop at the first failure, wile some other implementations will fill the untransformable points with NaN values, continue and throw the exception only at end. Implementations that fall in the later case should set the last completed transform to this.
        Since:
        GeoAPI 2.2
      • derivative

        Matrix derivative​(Position point)
                   throws MismatchedDimensionException,
                          TransformException
        Gets the derivative of this transform at a point. The derivative is the matrix of the non-translating portion of the approximate affine map at the point. The matrix will have dimensions corresponding to the source and target coordinate systems. If the input dimension is M, and the output dimension is N, then the matrix will have size N×M. The elements of the matrix {en,m : n=0..(N-1)} form a vector in the output space which is parallel to the displacement caused by a small change in the m'th ordinate in the input space.

        For example, if the input dimension is 4 and the output dimension is 3, then a small displacement (x0, x1, x2, x3) in the input space will result in a displacement (y0, y1, y2) in the output space computed as below (en,m are the matrix's elements):

         [ y0 ]     [ e00  e01  e02  e03 ] [ x0 ]
         [ y1 ]  =  [ e10  e11  e12  e13 ] [ x1 ]
         [ y2 ]     [ e20  e21  e22  e23 ] [ x2 ]
                                           [ x3 ]
         
        Parameters:
        point - The coordinate point where to evaluate the derivative. Null value is accepted only if the derivative is the same everywhere. For example affine transform accept null value since they produces identical derivative no matter the coordinate value. But most map projection will requires a non-null value.
        Returns:
        The derivative at the specified point (never null). This method never returns an internal object: changing the matrix will not change the state of this math transform.
        Throws:
        NullPointerException - if the derivative dependents on coordinate and point is null.
        MismatchedDimensionException - if point doesn't have the expected dimension.
        TransformException - if the derivative can't be evaluated at the specified point.
      • inverse

        MathTransform inverse()
                       throws NoninvertibleTransformException
        Creates the inverse transform of this object. The target of the inverse transform is the source of the original. The source of the inverse transform is the target of the original. Using the original transform followed by the inverse's transform will result in an identity map on the source coordinate space, when allowances for error are made. This method may fail if the transform is not one to one. However, all cartographic projections should succeed.
        Returns:
        The inverse transform.
        Throws:
        NoninvertibleTransformException - if the transform can't be inversed.
      • isIdentity

        boolean isIdentity()
        Tests whether this transform does not move any points.
        Returns:
        true if this MathTransform is an identity transform; false otherwise.