org.geotools.ct
Class AbstractMathTransform

java.lang.Object
  extended byorg.geotools.ct.AbstractMathTransform
All Implemented Interfaces:
MathTransform
Direct Known Subclasses:
AbstractMathTransform.Inverse, MapProjection

Deprecated. Replaced by AbstractMathTransform in the org.geotools.referencing.operation.transform package.

public abstract class AbstractMathTransform
extends java.lang.Object
implements MathTransform

Provides a default implementations for most methods required by the MathTransform interface. AbstractMathTransform provides a convenient base class from which other transform classes can be easily derived. In addition, AbstractMathTransform implements methods required by the MathTransform2D interface, but does not implements MathTransform2D. Subclasses must declare implements MathTransform2D themself if they know to maps two-dimensional coordinate systems.

Version:
$Id: AbstractMathTransform.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux

Nested Class Summary
protected  class AbstractMathTransform.Inverse
          Deprecated. Default implementation for inverse math transform.
 
Constructor Summary
AbstractMathTransform()
          Deprecated. Construct a math transform.
 
Method Summary
 java.awt.Shape createTransformedShape(java.awt.Shape shape)
          Deprecated. Transform the specified shape.
 Matrix derivative(CoordinatePoint point)
          Deprecated. Gets the derivative of this transform at a point.
 Matrix derivative(java.awt.geom.Point2D point)
          Deprecated. Gets the derivative of this transform at a point.
 boolean equals(java.lang.Object object)
          Deprecated. Compares the specified object with this math transform for equality.
static MathTransform fromGeoAPI(org.opengis.referencing.operation.MathTransform mt)
          Deprecated. Mimic a GeoAPI interface as a legacy implementation.
protected  java.lang.String getName(java.util.Locale locale)
          Deprecated. Returns a human readable name, if available.
 int hashCode()
          Deprecated. Returns a hash value for this transform.
 MathTransform inverse()
          Deprecated. Creates the inverse transform of this object.
 boolean isIdentity()
          Deprecated. Tests whether this transform does not move any points.
 java.lang.String toString()
          Deprecated. Returns a string repr?sentation of this transform.
 CoordinatePoint transform(CoordinatePoint ptSrc, CoordinatePoint ptDst)
          Deprecated. Transforms the specified ptSrc and stores the result in ptDst.
 void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
          Deprecated. Transforms a list of coordinate point ordinal values.
 java.awt.geom.Point2D transform(java.awt.geom.Point2D ptSrc, java.awt.geom.Point2D ptDst)
          Deprecated. Transforms the specified ptSrc and stores the result in ptDst.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.geotools.ct.MathTransform
getDimSource, getDimTarget, transform
 

Constructor Detail

AbstractMathTransform

public AbstractMathTransform()
Deprecated. 
Construct a math transform.

Method Detail

getName

protected java.lang.String getName(java.util.Locale locale)
Deprecated. 
Returns a human readable name, if available. If no name is available in the specified locale, then this method returns a name in an arbitrary locale. If no name is available in any locale, then this method returns null. The default implementation always returns null.

Parameters:
locale - The desired locale, or null for a default locale.
Returns:
The transform name localized in the specified locale if possible, or null if no name is available in any locale.

isIdentity

public boolean isIdentity()
Deprecated. 
Tests whether this transform does not move any points. The default implementation always returns false.

Specified by:
isIdentity in interface MathTransform
Returns:
true if this MathTransform is an identity transform; false otherwise.
See Also:
CT_MathTransform.isIdentity()

transform

public java.awt.geom.Point2D transform(java.awt.geom.Point2D ptSrc,
                                       java.awt.geom.Point2D ptDst)
                                throws org.opengis.referencing.operation.TransformException
Deprecated. 
Transforms the specified ptSrc and stores the result in ptDst. The default implementation invokes MathTransform.transform(double[],int,double[],int,int) using a temporary array of doubles.

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 stroring the result in ptDst.
Throws:
org.opengis.spatialschema.geometry.MismatchedDimensionException - if this transform doesn't map two-dimensional coordinate systems.
org.opengis.referencing.operation.TransformException - if the point can't be transformed.
See Also:
MathTransform2D.transform(Point2D,Point2D)

transform

public CoordinatePoint transform(CoordinatePoint ptSrc,
                                 CoordinatePoint ptDst)
                          throws org.opengis.referencing.operation.TransformException
Deprecated. 
Transforms the specified ptSrc and stores the result in ptDst. The default implementation invokes MathTransform.transform(double[],int,double[],int,int).

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:
org.opengis.referencing.operation.TransformException - if the point can't be transformed.
See Also:
CT_MathTransform.transform(org.opengis.pt.PT_CoordinatePoint)

transform

public void transform(float[] srcPts,
                      int srcOff,
                      float[] dstPts,
                      int dstOff,
                      int numPts)
               throws org.opengis.referencing.operation.TransformException
Deprecated. 
Transforms a list of coordinate point ordinal values. The default implementation invokes MathTransform.transform(double[],int,double[],int,int) using a temporary array of doubles.

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:
org.opengis.referencing.operation.TransformException - if a point can't be transformed.

createTransformedShape

public java.awt.Shape createTransformedShape(java.awt.Shape shape)
                                      throws org.opengis.referencing.operation.TransformException
Deprecated. 
Transform the specified shape. The default implementation compute quadratic curves using three points for each shape's segments.

Parameters:
shape - Shape to transform.
Returns:
Transformed shape, or shape if this transform is the identity transform.
Throws:
java.lang.IllegalStateException - if this transform doesn't map 2D coordinate systems.
org.opengis.referencing.operation.TransformException - if a transform failed.
See Also:
MathTransform2D.createTransformedShape(Shape)

derivative

public Matrix derivative(java.awt.geom.Point2D point)
                  throws org.opengis.referencing.operation.TransformException
Deprecated. 
Gets the derivative of this transform at a point. The default implementation always throw an exception. Subclasses that implement the MathTransform2D interface should override this method. Other subclasses should override derivative(CoordinatePoint) instead.

Parameters:
point - The coordinate point where to evaluate the derivative.
Returns:
The derivative at the specified point as a 2×2 matrix.
Throws:
org.opengis.spatialschema.geometry.MismatchedDimensionException - if the input dimension is not 2.
org.opengis.referencing.operation.TransformException - if the derivative can't be evaluated at the specified point.
See Also:
MathTransform2D.derivative(Point2D)

derivative

public Matrix derivative(CoordinatePoint point)
                  throws org.opengis.referencing.operation.TransformException
Deprecated. 
Gets the derivative of this transform at a point. The default implementation ensure that point has a valid dimension. Next, it try to delegate the work to an other method: Otherwise, a TransformException is thrown.

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:
java.lang.NullPointerException - if the derivative dependents on coordinate and point is null.
org.opengis.spatialschema.geometry.MismatchedDimensionException - if point doesn't have the expected dimension.
org.opengis.referencing.operation.TransformException - if the derivative can't be evaluated at the specified point.
See Also:
CT_MathTransform.derivative(org.opengis.pt.PT_CoordinatePoint)

inverse

public MathTransform inverse()
                      throws org.opengis.referencing.operation.NoninvertibleTransformException
Deprecated. 
Creates the inverse transform of this object. The default implementation returns this if this transform is an identity transform, and throws a NoninvertibleTransformException otherwise. Subclasses should override this method.

Specified by:
inverse in interface MathTransform
Returns:
The inverse transform.
Throws:
org.opengis.referencing.operation.NoninvertibleTransformException - if the transform can't be inversed.
See Also:
CT_MathTransform.inverse()

hashCode

public int hashCode()
Deprecated. 
Returns a hash value for this transform.


equals

public boolean equals(java.lang.Object object)
Deprecated. 
Compares the specified object with this math transform for equality. The default implementation checks if object is an instance of the same class than this. Subclasses should override this method in order to compare internal fields.


toString

public java.lang.String toString()
Deprecated. 
Returns a string repr?sentation of this transform. Subclasses should override this method in order to returns Well Know Text (WKT) instead.


fromGeoAPI

public static MathTransform fromGeoAPI(org.opengis.referencing.operation.MathTransform mt)
                                throws UnsupportedImplementationException
Deprecated. 
Mimic a GeoAPI interface as a legacy implementation. This method is provided as a temporary bridge for using new CRS object with J2D-Renderer for example.

Throws:
UnsupportedImplementationException


Copyright © GeoTools. All Rights Reserved.