Java Doc for AbstractMathTransform.java in  » GIS » GeoTools-2.4.1 » org » geotools » referencing » operation » transform » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoTools 2.4.1 » org.geotools.referencing.operation.transform 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.geotools.referencing.wkt.Formattable
      org.geotools.referencing.operation.transform.AbstractMathTransform

All known Subclasses:   org.geotools.referencing.operation.transform.MolodenskiTransform,  org.geotools.referencing.operation.transform.LogarithmicTransform1D,  org.geotools.referencing.operation.projection.MapProjection,  org.geotools.referencing.operation.transform.ExponentialTransform1D,  org.geotools.referencing.operation.transform.LinearTransform1D,  org.geotools.referencing.operation.transform.IdentityTransform,  org.geotools.referencing.operation.transform.NADCONTransform,  org.geotools.referencing.operation.transform.ProjectiveTransform,  org.geotools.referencing.operation.builder.LocalizationGridTransform2D,  org.geotools.referencing.operation.transform.GeocentricTransform,  org.geotools.referencing.operation.transform.PassThroughTransform,  org.geotools.referencing.operation.transform.WarpTransform2D,  org.geotools.referencing.operation.transform.ConcatenatedTransform,  org.geotools.referencing.operation.builder.RubberSheetTransform,  org.geotools.referencing.operation.transform.VerticalTransform,
AbstractMathTransform
abstract public class AbstractMathTransform extends Formattable implements MathTransform(Code)
Provides a default implementation 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.
since:
   2.0
version:
   $Id: AbstractMathTransform.java 24925 2007-03-27 20:12:08Z jgarnett $
author:
   Martin Desruisseaux

Inner Class :abstract protected class Inverse extends AbstractMathTransform implements Serializable


Constructor Summary
protected  AbstractMathTransform()
     Constructs a math transform.

Method Summary
 MathTransformconcatenate(MathTransform other, boolean applyOtherFirst)
     Concatenates in an optimized way a MathTransform other to this MathTransform .
public  ShapecreateTransformedShape(Shape shape)
     Transform the specified shape.
final  ShapecreateTransformedShape(Shape shape, AffineTransform preTransform, AffineTransform postTransform, int orientation)
     Transforms a geometric shape.
public  Matrixderivative(Point2D point)
     Gets the derivative of this transform at a point.
public  Matrixderivative(DirectPosition point)
     Gets the derivative of this transform at a point.
protected static  voidensureNonNull(String name, Object object)
     Makes sure that an argument is non-null.
public  booleanequals(Object object)
     Compares the specified object with this math transform for equality.
protected  StringformatWKT(Formatter formatter)
     Format the inner part of a Well Known Text (WKT) element.
public  ParameterDescriptorGroupgetParameterDescriptors()
     Returns the parameter descriptors for this math transform, or null if unknow.
public  ParameterValueGroupgetParameterValues()
     Returns the parameter values for this math transform, or null if unknow.
abstract public  intgetSourceDimensions()
     Gets the dimension of input points.
abstract public  intgetTargetDimensions()
     Gets the dimension of output points.
public  inthashCode()
     Returns a hash value for this transform.
public  MathTransforminverse()
     Creates the inverse transform of this object. The default implementation returns this if this transform is an identity transform, and throws a NoninvertibleTransformException otherwise.
static  Matrixinvert(Matrix matrix)
     Inverts the specified matrix in place.
public  booleanisIdentity()
     Tests whether this transform does not move any points.
protected static  booleanneedCopy(int srcOff, int dimSource, int dstOff, int dimTarget, int numPts)
     Checks if source coordinates need to be copied before to apply the transformation. This convenience method is provided for transform(...) method implementation. This method make the following assumptions:

  • Coordinates will be iterated from lower index to upper index.
  • Coordinates are read and writen in shrunk.
protected static  doublerollLongitude(double x)
     Ensures that the specified longitude stay within ±π radians.
static  GeneralMatrixtoGMatrix(Matrix matrix)
     Wraps the specified matrix in a Geotools implementation of Matrix .
static  XMatrixtoXMatrix(Matrix matrix)
     Wraps the specified matrix in a Geotools implementation of Matrix .
public  Point2Dtransform(Point2D ptSrc, Point2D ptDst)
     Transforms the specified ptSrc and stores the result in ptDst . The default implementation invokes AbstractMathTransform.transform(double[],int,double[],int,int) using a temporary array of doubles.
Parameters:
  ptSrc - the specified coordinate point to be transformed.
Parameters:
  ptDst - the specified coordinate point that stores the result of transforming ptSrc , or null .
public  DirectPositiontransform(DirectPosition ptSrc, DirectPosition ptDst)
     Transforms the specified ptSrc and stores the result in ptDst .
public  voidtransform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
     Transforms a list of coordinate point ordinal values.


Constructor Detail
AbstractMathTransform
protected AbstractMathTransform()(Code)
Constructs a math transform.




Method Detail
concatenate
MathTransform concatenate(MathTransform other, boolean applyOtherFirst)(Code)
Concatenates in an optimized way a MathTransform other to this MathTransform . A new math transform is created to perform the combined transformation. The applyOtherFirst value determine the transformation order as bellow:
  • If applyOtherFirst is true , then transforming a point p by the combined transform is equivalent to first transforming p by other and then transforming the result by the original transform this .
  • If applyOtherFirst is false , then transforming a point p by the combined transform is equivalent to first transforming p by the original transform this and then transforming the result by other .
If no special optimization is available for the combined transform, then this method returns null . In the later case, the concatenation will be prepared by DefaultMathTransformFactory using a generic ConcatenatedTransform . The default implementation always returns null . This method is ought to be overridden by subclasses capable of concatenating some combinaison of transforms in a special way. Examples are ExponentialTransform1D and LogarithmicTransform1D .
Parameters:
  other - The math transform to apply.
Parameters:
  applyOtherFirst - true if the transformation order is other followed by this , or false if the transformation order is this followed by other . The combined math transform, or null if no optimized combinedtransform is available.



createTransformedShape
public Shape createTransformedShape(Shape shape) throws TransformException(Code)
Transform the specified shape. The default implementation computes quadratic curves using three points for each shape segments.
Parameters:
  shape - Shape to transform. Transformed shape, or shape if this transform is the identity transform.
throws:
  IllegalStateException - if this transform doesn't map 2D coordinate systems.
throws:
  TransformException - if a transform failed.
See Also:   MathTransform2D.createTransformedShape(Shape)



createTransformedShape
final Shape createTransformedShape(Shape shape, AffineTransform preTransform, AffineTransform postTransform, int orientation) throws TransformException(Code)
Transforms a geometric shape. This method always copy transformed coordinates in a new object. The new object is usually a GeneralPath , but may also be a Line2D or a QuadCurve2D if such simplification is possible.
Parameters:
  shape - The geometric shape to transform.
Parameters:
  preTransform - An optional affine transform to apply before thetransformation using this , or null if none.
Parameters:
  postTransform - An optional affine transform to apply after the transformationusing this , or null if none.
Parameters:
  orientation - Base line of quadratic curves. Must beShapeUtilities.HORIZONTAL or ShapeUtilities.PARALLEL). The transformed geometric shape.
throws:
  MismatchedDimensionException - if this transform doesn't is not two-dimensional.
throws:
  TransformException - If a transformation failed.



derivative
public Matrix derivative(Point2D point) throws TransformException(Code)
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 AbstractMathTransform.derivative(DirectPosition) instead.
Parameters:
  point - The coordinate point where to evaluate the derivative. The derivative at the specified point as a 2×2 matrix.
throws:
  MismatchedDimensionException - if the input dimension is not 2.
throws:
  TransformException - if the derivative can't be evaluated at the specified point.
See Also:   MathTransform2D.derivative(Point2D)



derivative
public Matrix derivative(DirectPosition point) throws TransformException(Code)
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:
  • If the input dimension is 2, then this method delegates the work to AbstractMathTransform.derivative(Point2D) .
  • If this object is an instance of MathTransform1D , then this method delegates the work to MathTransform1D.derivative(double)derivative(double) .
Otherwise, a TransformException is thrown.
Parameters:
  point - The coordinate point where to evaluate the derivative. The derivative at the specified point (never null ).
throws:
  NullPointerException - if the derivative dependents on coordinateand point is null .
throws:
  MismatchedDimensionException - if point doesn't havethe expected dimension.
throws:
  TransformException - if the derivative can't be evaluated at thespecified point.



ensureNonNull
protected static void ensureNonNull(String name, Object object) throws IllegalArgumentException(Code)
Makes sure that an argument is non-null. This is a convenience method for subclass constructors.
Parameters:
  name - Argument name.
Parameters:
  object - User argument.
throws:
  InvalidParameterValueException - if object is null.



equals
public boolean equals(Object object)(Code)
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 and use the same parameter descriptor. Subclasses should override this method in order to compare internal fields.



formatWKT
protected String formatWKT(Formatter formatter)(Code)
Format the inner part of a Well Known Text (WKT) element. The default implementation formats all parameter values returned by AbstractMathTransform.getParameterValues . The parameter group name is used as the math transform name.
Parameters:
  formatter - The formatter to use. The WKT element name, which is "PARAM_MT" in the default implementation.



getParameterDescriptors
public ParameterDescriptorGroup getParameterDescriptors()(Code)
Returns the parameter descriptors for this math transform, or null if unknow. This method is similar to OperationMethod.getParameters , except that MathTransform returns parameters in standard units (usually or ). The parameter descriptors for this math transform, or null .
See Also:   OperationMethod.getParameters



getParameterValues
public ParameterValueGroup getParameterValues()(Code)
Returns the parameter values for this math transform, or null if unknow. This method is similar to Operation.getParameterValues , except that MathTransform returns parameters in standard units (usually or ). Since this method returns a copy of the parameter values, any change to a value will have no effect on this math transform. A copy of the parameter values for this math transform, or null .
See Also:   Operation.getParameterValues



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



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



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



inverse
public MathTransform inverse() throws NoninvertibleTransformException(Code)
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.



invert
static Matrix invert(Matrix matrix) throws NoninvertibleTransformException(Code)
Inverts the specified matrix in place. If the matrix can't be inverted (for example because of a SingularMatrixException ), then the exception is wrapped into a NoninvertibleTransformException .



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



needCopy
protected static boolean needCopy(int srcOff, int dimSource, int dstOff, int dimTarget, int numPts)(Code)
Checks if source coordinates need to be copied before to apply the transformation. This convenience method is provided for transform(...) method implementation. This method make the following assumptions:

  • Coordinates will be iterated from lower index to upper index.
  • Coordinates are read and writen in shrunk. For example (longitude,latitude,height) values for one coordinate are read together, and the transformed (x,y,z) values are written together only after.


However, this method does not assumes that source and target dimension are the same (in the special case where source and target dimension are always the same, a simplier and more efficient check is possible). The following example prepares a transformation from 2 dimensional points to three dimensional points:

 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;
 }
 }



rollLongitude
protected static double rollLongitude(double x)(Code)
Ensures that the specified longitude stay within ±π radians. This method is typically invoked after geographic coordinates are transformed. This method may add or substract some amount of 2π radians to x.
Parameters:
  x - The longitude in radians. The longitude in the range ±π radians.



toGMatrix
static GeneralMatrix toGMatrix(Matrix matrix)(Code)
Wraps the specified matrix in a Geotools implementation of Matrix . If matrix is already an instance of GeneralMatrix , then it is returned unchanged. Otherwise, all elements are copied in a new GeneralMatrix object.

Before to use this method, check if a XMatrix (to be obtained with AbstractMathTransform.toXMatrix ) would be suffisient. Use this method only if a GeneralMatrix is really necessary.




toXMatrix
static XMatrix toXMatrix(Matrix matrix)(Code)
Wraps the specified matrix in a Geotools implementation of Matrix . If matrix is already an instance of XMatrix , then it is returned unchanged. Otherwise, all elements are copied in a new XMatrix object.



transform
public Point2D transform(Point2D ptSrc, Point2D ptDst) throws TransformException(Code)
Transforms the specified ptSrc and stores the result in ptDst . The default implementation invokes AbstractMathTransform.transform(double[],int,double[],int,int) using a temporary array of doubles.
Parameters:
  ptSrc - the specified coordinate point to be transformed.
Parameters:
  ptDst - the specified coordinate point that stores the result of transforming ptSrc , or null . the coordinate point after transforming ptSrc and storing the result in ptDst .
throws:
  MismatchedDimensionException - if this transform doesn't map two-dimensionalcoordinate systems.
throws:
  TransformException - if the point can't be transformed.
See Also:   MathTransform2D.transform(Point2DPoint2D)



transform
public DirectPosition transform(DirectPosition ptSrc, DirectPosition ptDst) throws TransformException(Code)
Transforms the specified ptSrc and stores the result in ptDst . The default implementation invokes AbstractMathTransform.transform(double[],int,double[],int,int) .



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



Methods inherited from org.geotools.referencing.wkt.Formattable
protected String formatWKT(Formatter formatter)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public String toWKT() throws UnformattableObjectException(Code)(Java Doc)
public String toWKT(int indentation) throws UnformattableObjectException(Code)(Java Doc)
public String toWKT(Citation authority, int indentation) throws UnformattableObjectException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.