org.geotools.referencing.operation.transform
Class IdentityTransform

java.lang.Object
  extended byorg.geotools.referencing.wkt.Formattable
      extended byorg.geotools.referencing.operation.transform.AbstractMathTransform
          extended byorg.geotools.referencing.operation.transform.IdentityTransform
All Implemented Interfaces:
LinearTransform, org.opengis.referencing.operation.MathTransform, java.io.Serializable

public class IdentityTransform
extends AbstractMathTransform
implements LinearTransform, java.io.Serializable

The identity transform. The data are only copied without any transformation. This class is used for identity transform of dimension greater than 2. For 1D and 2D identity transforms, LinearTransform1D and AffineTransform already provide their own optimisations.

Since:
2.0
Version:
$Id: IdentityTransform.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.geotools.referencing.operation.transform.AbstractMathTransform
AbstractMathTransform.Inverse
 
Constructor Summary
protected IdentityTransform(int dimension)
          Constructs an identity transform of the specified dimension.
 
Method Summary
static LinearTransform create(int dimension)
          Constructs an identity transform of the specified dimension.
 org.opengis.referencing.operation.Matrix derivative(org.opengis.spatialschema.geometry.DirectPosition point)
          Gets the derivative of this transform at a point.
 boolean equals(java.lang.Object object)
          Compares the specified object with this math transform for equality.
 org.opengis.referencing.operation.Matrix getMatrix()
          Returns a copy of the identity matrix.
 org.opengis.parameter.ParameterDescriptorGroup getParameterDescriptors()
          Returns the parameter descriptors for this math transform.
 org.opengis.parameter.ParameterValueGroup getParameterValues()
          Returns the matrix elements as a group of parameters values.
 int getSourceDimensions()
          Gets the dimension of input points.
 int getTargetDimensions()
          Gets the dimension of output points.
 int hashCode()
          Returns a hash value for this transform.
 org.opengis.referencing.operation.MathTransform inverse()
          Returns the inverse transform of this object, which is this transform itself
 boolean isIdentity()
          Tests whether this transform does not move any points.
 org.opengis.spatialschema.geometry.DirectPosition transform(org.opengis.spatialschema.geometry.DirectPosition ptSrc, org.opengis.spatialschema.geometry.DirectPosition ptDst)
          Copies the values from to .
 void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
          Transforms an array of floating point coordinates by this transform.
 void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
          Transforms an array of floating point coordinates by this transform.
 
Methods inherited from class org.geotools.referencing.operation.transform.AbstractMathTransform
createTransformedShape, derivative, ensureNonNull, formatWKT, getDimSource, getDimTarget, needCopy, rollLongitude, transform
 
Methods inherited from class org.geotools.referencing.wkt.Formattable
toString, toWKT, toWKT, toWKT
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opengis.referencing.operation.MathTransform
toWKT
 

Constructor Detail

IdentityTransform

protected IdentityTransform(int dimension)
Constructs an identity transform of the specified dimension.

Method Detail

create

public static LinearTransform create(int dimension)
Constructs an identity transform of the specified dimension.


isIdentity

public boolean isIdentity()
Tests whether this transform does not move any points.

Specified by:
isIdentity in interface org.opengis.referencing.operation.MathTransform
Overrides:
isIdentity in class AbstractMathTransform

getSourceDimensions

public int getSourceDimensions()
Gets the dimension of input points.

Specified by:
getSourceDimensions in interface org.opengis.referencing.operation.MathTransform
Specified by:
getSourceDimensions in class AbstractMathTransform

getTargetDimensions

public int getTargetDimensions()
Gets the dimension of output points.

Specified by:
getTargetDimensions in interface org.opengis.referencing.operation.MathTransform
Specified by:
getTargetDimensions in class AbstractMathTransform

getParameterDescriptors

public org.opengis.parameter.ParameterDescriptorGroup getParameterDescriptors()
Returns the parameter descriptors for this math transform.

Overrides:
getParameterDescriptors in class AbstractMathTransform
Returns:
The parameter descriptors for this math transform, or .
See Also:
OperationMethod.getParameters()

getParameterValues

public org.opengis.parameter.ParameterValueGroup getParameterValues()
Returns the matrix elements as a group of parameters values.

Overrides:
getParameterValues in class AbstractMathTransform
Returns:
A copy of the parameter values for this math transform.
See Also:
Operation.getParameterValues()

getMatrix

public org.opengis.referencing.operation.Matrix getMatrix()
Returns a copy of the identity matrix.

Specified by:
getMatrix in interface LinearTransform

derivative

public org.opengis.referencing.operation.Matrix derivative(org.opengis.spatialschema.geometry.DirectPosition point)
Gets the derivative of this transform at a point. For an identity transform, the derivative is the same everywhere.

Specified by:
derivative in interface org.opengis.referencing.operation.MathTransform
Overrides:
derivative in class AbstractMathTransform
Parameters:
point - The coordinate point where to evaluate the derivative.
Returns:
The derivative at the specified point (never ).

transform

public org.opengis.spatialschema.geometry.DirectPosition transform(org.opengis.spatialschema.geometry.DirectPosition ptSrc,
                                                                   org.opengis.spatialschema.geometry.DirectPosition ptDst)
Copies the values from to . Overrides the super-class method for performance reason.

Specified by:
transform in interface org.opengis.referencing.operation.MathTransform
Overrides:
transform in class AbstractMathTransform
Since:
2.2

transform

public void transform(float[] srcPts,
                      int srcOff,
                      float[] dstPts,
                      int dstOff,
                      int numPts)
Transforms an array of floating point coordinates by this transform.

Specified by:
transform in interface org.opengis.referencing.operation.MathTransform
Overrides:
transform in class AbstractMathTransform

transform

public void transform(double[] srcPts,
                      int srcOff,
                      double[] dstPts,
                      int dstOff,
                      int numPts)
Transforms an array of floating point coordinates by this transform.

Specified by:
transform in interface org.opengis.referencing.operation.MathTransform

inverse

public org.opengis.referencing.operation.MathTransform inverse()
Returns the inverse transform of this object, which is this transform itself

Specified by:
inverse in interface org.opengis.referencing.operation.MathTransform
Overrides:
inverse in class AbstractMathTransform

hashCode

public int hashCode()
Returns a hash value for this transform. This value need not remain consistent between different implementations of the same class.

Overrides:
hashCode in class AbstractMathTransform

equals

public boolean equals(java.lang.Object object)
Compares the specified object with this math transform for equality.

Overrides:
equals in class AbstractMathTransform


Copyright © GeoTools. All Rights Reserved.