|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.referencing.wkt.Formattable org.geotools.referencing.operation.transform.AbstractMathTransform
Provides a default implementation for most methods required by the
MathTransform
interface.
provides a convenient base class from which other transform classes
can be easily derived. In addition,
implements methods required by the MathTransform2D
interface,
but does not implements .
Subclasses must declare implements MathTransform2D
themself if they know to maps two-dimensional coordinate systems.
Nested Class Summary | |
protected class |
AbstractMathTransform.Inverse
Default implementation for inverse math transform. |
Constructor Summary | |
protected |
AbstractMathTransform()
Constructs a math transform. |
Method Summary | |
java.awt.Shape |
createTransformedShape(java.awt.Shape shape)
Transform the specified shape. |
org.opengis.referencing.operation.Matrix |
derivative(org.opengis.spatialschema.geometry.DirectPosition point)
Gets the derivative of this transform at a point. |
org.opengis.referencing.operation.Matrix |
derivative(java.awt.geom.Point2D point)
Gets the derivative of this transform at a point. |
protected static void |
ensureNonNull(java.lang.String name,
java.lang.Object object)
Makes sure that an argument is non-null. |
boolean |
equals(java.lang.Object object)
Compares the specified object with this math transform for equality. |
protected java.lang.String |
formatWKT(Formatter formatter)
Format the inner part of a Well Known Text (WKT) element. |
int |
getDimSource()
Deprecated. Renamed getSourceDimensions() for consistency with OperationMethod . |
int |
getDimTarget()
Deprecated. Renamed getTargetDimensions() for consistency with OperationMethod . |
org.opengis.parameter.ParameterDescriptorGroup |
getParameterDescriptors()
Returns the parameter descriptors for this math transform, or if unknow. |
org.opengis.parameter.ParameterValueGroup |
getParameterValues()
Returns the parameter values for this math transform, or if unknow. |
abstract int |
getSourceDimensions()
Gets the dimension of input points. |
abstract int |
getTargetDimensions()
Gets the dimension of output points. |
int |
hashCode()
Returns a hash value for this transform. |
org.opengis.referencing.operation.MathTransform |
inverse()
Creates the inverse transform of this object. |
boolean |
isIdentity()
Tests whether this transform does not move any points. |
protected static boolean |
needCopy(int srcOff,
int dimSource,
int dstOff,
int dimTarget,
int numPts)
Checks if source coordinates need to be copied before to apply the transformation. |
protected static double |
rollLongitude(double x)
Ensures that the specified longitude stay within ±π radians. |
org.opengis.spatialschema.geometry.DirectPosition |
transform(org.opengis.spatialschema.geometry.DirectPosition ptSrc,
org.opengis.spatialschema.geometry.DirectPosition ptDst)
Transforms the specified and stores the result in . |
void |
transform(float[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts)
Transforms a list of coordinate point ordinal values. |
java.awt.geom.Point2D |
transform(java.awt.geom.Point2D ptSrc,
java.awt.geom.Point2D ptDst)
Transforms the specified and stores the result in . |
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, transform |
Constructor Detail |
protected AbstractMathTransform()
Method Detail |
public final int getDimSource()
getSourceDimensions()
for consistency with OperationMethod
.
public abstract int getSourceDimensions()
getSourceDimensions
in interface org.opengis.referencing.operation.MathTransform
public final int getDimTarget()
getTargetDimensions()
for consistency with OperationMethod
.
public abstract int getTargetDimensions()
getTargetDimensions
in interface org.opengis.referencing.operation.MathTransform
public org.opengis.parameter.ParameterDescriptorGroup getParameterDescriptors()
OperationMethod.getParameters()
, except that
returns parameters in standard units (usually
meters or degrees).
OperationMethod.getParameters()
public org.opengis.parameter.ParameterValueGroup getParameterValues()
Operation.getParameterValues()
, except that
returns parameters in standard units (usually
meters or degrees). Since this
method returns a copy of the parameter values, any change to a value will have no effect
on this math transform.
Operation.getParameterValues()
public boolean isIdentity()
isIdentity
in interface org.opengis.referencing.operation.MathTransform
public java.awt.geom.Point2D transform(java.awt.geom.Point2D ptSrc, java.awt.geom.Point2D ptDst) throws org.opengis.referencing.operation.TransformException
MathTransform.transform(double[],int,double[],int,int)
using a temporary array of doubles.
ptSrc
- the specified coordinate point to be transformed.ptDst
- the specified coordinate point that stores the result of transforming
, or .
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.MathTransform2D.transform(Point2D,Point2D)
public org.opengis.spatialschema.geometry.DirectPosition transform(org.opengis.spatialschema.geometry.DirectPosition ptSrc, org.opengis.spatialschema.geometry.DirectPosition ptDst) throws org.opengis.referencing.operation.TransformException
MathTransform.transform(double[],int,double[],int,int)
.
transform
in interface org.opengis.referencing.operation.MathTransform
org.opengis.referencing.operation.TransformException
public void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) throws org.opengis.referencing.operation.TransformException
MathTransform.transform(double[],int,double[],int,int)
using a temporary array
of doubles.
transform
in interface org.opengis.referencing.operation.MathTransform
org.opengis.referencing.operation.TransformException
public java.awt.Shape createTransformedShape(java.awt.Shape shape) throws org.opengis.referencing.operation.TransformException
shape
- Shape to transform.
java.lang.IllegalStateException
- if this transform doesn't map 2D coordinate systems.
org.opengis.referencing.operation.TransformException
- if a transform failed.MathTransform2D.createTransformedShape(Shape)
public org.opengis.referencing.operation.Matrix derivative(java.awt.geom.Point2D point) throws org.opengis.referencing.operation.TransformException
MathTransform2D
interface
should override this method. Other subclasses should override
derivative(DirectPosition)
instead.
point
- The coordinate point where to evaluate the derivative.
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.MathTransform2D.derivative(Point2D)
public org.opengis.referencing.operation.Matrix derivative(org.opengis.spatialschema.geometry.DirectPosition point) throws org.opengis.referencing.operation.TransformException
derivative(Point2D)
.MathTransform1D
, then this
method delegates the work to derivative(double)
.TransformException
is thrown.
derivative
in interface org.opengis.referencing.operation.MathTransform
point
- The coordinate point where to evaluate the derivative.
java.lang.NullPointerException
- if the derivative dependents on coordinate
and is .
org.opengis.spatialschema.geometry.MismatchedDimensionException
- if doesn't have
the expected dimension.
org.opengis.referencing.operation.TransformException
- if the derivative can't be evaluated at the
specified point.public org.opengis.referencing.operation.MathTransform inverse() throws org.opengis.referencing.operation.NoninvertibleTransformException
NoninvertibleTransformException
otherwise. Subclasses
should override this method.
inverse
in interface org.opengis.referencing.operation.MathTransform
org.opengis.referencing.operation.NoninvertibleTransformException
public int hashCode()
public boolean equals(java.lang.Object object)
protected java.lang.String formatWKT(Formatter formatter)
getParameterValues()
. The parameter group name is used as the math
transform name.
formatWKT
in class Formattable
formatter
- The formatter to use.
Formattable.toWKT()
,
Formattable.toString()
protected static void ensureNonNull(java.lang.String name, java.lang.Object object) throws java.lang.IllegalArgumentException
name
- Argument name.object
- User argument.
org.opengis.parameter.InvalidParameterValueException
- if is null.
java.lang.IllegalArgumentException
protected static boolean needCopy(int srcOff, int dimSource, int dstOff, int dimTarget, int numPts)
public void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) { if (srcPts==dstPts && needCopy(srcOff, 2, dstOff, 3, numPts) { final double[] old = srcPts; srcPts = new double[numPts*2]; System.arraycopy(old, srcOff, srcPts, 0, srcPts.length); srcOff = 0; } }
protected static double rollLongitude(double x)
x
- The longitude in radians.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |