Java Doc for TransformedDirectPosition.java in  » GIS » GeoTools-2.4.1 » org » geotools » geometry » 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.geometry 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.geotools.geometry.AbstractDirectPosition
      org.geotools.geometry.GeneralDirectPosition
         org.geotools.geometry.TransformedDirectPosition

TransformedDirectPosition
public class TransformedDirectPosition extends GeneralDirectPosition (Code)
A direct position capable to a point between an arbitrary CRS and . This class caches the last transform used in order to improve the performances when the and CRS don't change often. Using this class is faster than invoking (sourceCRS, targetCRS) for every points.
  • Note 1: This class is advantageous on a performance point of view only if the same instance of TransformedDirectPosition is used for transforming many points between arbitrary CRS and this .

  • Note 2: This convenience class is useful when the source and target CRS are not likely to change often. If you are sure that the source and target CRS will not change at all for a given set of positions, then using CoordinateOperation directly gives better performances. This is because TransformedDirectPosition checks if the CRS changed before every transformations, which may be costly.

  • Note 3: This class is called Transformed Direct Position because it is more commonly used for transforming many points from arbitrary CRS to a common CRS (using the TransformedDirectPosition.transform(DirectPosition) method) than the other way around.

This class usually don't appears in a public API. It is more typicaly used as a helper private field in some more complex class. For example suppose that MyClass needs to perform its internal working in some particular CRS, but we want robust API that adjusts itself to whatever CRS the client happen to use. MyClass could be written as below:
 public class MyClass {
 private static final CoordinateReferenceSystem   PUBLIC_CRS = ...
 private static final CoordinateReferenceSystem INTERNAL_CRS = ...
 private final TransformedDirectPosition myPosition = 
 new TransformedDirectPosition(PUBLIC_CRS, INTERNAL_CRS, null);
 public void setPosition(DirectPosition position) throws TransformException {
 // The position CRS is usually PUBLIC_CRS, but code below will work even if it is not.
 myPosition.transform(position);
 }
 public DirectPosition getPosition() throws TransformException {
 return myPosition.inverseTransform(PUBLIC_CRS);
 }
 }
 

since:
   2.2
author:
   Martin Desruisseaux
version:
   $Id: TransformedDirectPosition.java 25050 2007-04-06 00:41:49Z jgarnett $



Constructor Summary
public  TransformedDirectPosition()
     Creates a new direct position initialized with the CRS.
public  TransformedDirectPosition(CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, Hints hints)
     Creates a new position which will contains the result of coordinate transformations from sourceCRS to targetCRS .

Method Summary
public  DirectPositioninverseTransform(CoordinateReferenceSystem crs)
     Returns a new point with the same coordinates than this one, but transformed in the given CRS.
public  DirectPositioninverseTransform()
     Returns a new point with the same coordinates than this one, but transformed in the sourceCRS given at .
public  voidsetCoordinateReferenceSystem(CoordinateReferenceSystem crs)
     Sets the coordinate reference system in which the coordinate is given.
public  voidtransform(DirectPosition position)
     Transforms a given position and stores the result in this object.
  • The is the , or the sourceCRS argument given at if and only if the CRS associated with position is null.

  • The is the .



Constructor Detail
TransformedDirectPosition
public TransformedDirectPosition()(Code)
Creates a new direct position initialized with the CRS.
since:
   2.3



TransformedDirectPosition
public TransformedDirectPosition(CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, Hints hints) throws FactoryRegistryException(Code)
Creates a new position which will contains the result of coordinate transformations from sourceCRS to targetCRS . The will be initially set to targetCRS .
Parameters:
  sourceCRS - The default CRS to be used by theTransformedDirectPosition.transform transform(position) method onlywhen the user-supplied position has a null.This sourceCRS argument may be null , in which case it is assumedthe same than targetCRS .
Parameters:
  targetCRS - The . Used for every untilthe next call to TransformedDirectPosition.setCoordinateReferenceSystem setCoordinateReferenceSystemor TransformedDirectPosition.setLocation(DirectPosition) setLocation. This argument can not be null.
Parameters:
  hints - The set of hints to use for fetching a CoordinateOperationFactory,or null if none.
throws:
  IllegalArgumentException - if targetCRS was null .
throws:
  FactoryRegistryException - if no can be found for the specified hints.
since:
   2.3




Method Detail
inverseTransform
public DirectPosition inverseTransform(CoordinateReferenceSystem crs) throws TransformException(Code)
Returns a new point with the same coordinates than this one, but transformed in the given CRS. This method never returns this , so the returned point usually doesn't need to be cloned.
Parameters:
  crs - The CRS for the position to be returned. The same position than this , but transformed in the specified CRS.
throws:
  TransformException - if a coordinate transformation was required and failed.
since:
   2.3



inverseTransform
public DirectPosition inverseTransform() throws TransformException(Code)
Returns a new point with the same coordinates than this one, but transformed in the sourceCRS given at . This method never returns this , so the returned point usually doesn't need to be cloned. The same position than this , but transformed in the source CRS.
throws:
  TransformException - if a coordinate transformation was required and failed.
since:
   2.3



setCoordinateReferenceSystem
public void setCoordinateReferenceSystem(CoordinateReferenceSystem crs) throws MismatchedDimensionException(Code)
Sets the coordinate reference system in which the coordinate is given. The given CRS will be used as:


Parameters:
  crs - The new CRS for this direct position.
throws:
  MismatchedDimensionException - if the specified CRS doesn't have the expectednumber of dimensions.



transform
public void transform(DirectPosition position) throws TransformException(Code)
Transforms a given position and stores the result in this object.
  • The is the , or the sourceCRS argument given at if and only if the CRS associated with position is null.

  • The is the . This is always the targetCRS argument given at or by the last call to TransformedDirectPosition.setCoordinateReferenceSystemsetCoordinateReferenceSystem .


Parameters:
  position - A position using an arbitrary CRS. This object will not be modified.
throws:
  TransformException - if a coordinate transformation was required and failed.



Fields inherited from org.geotools.geometry.GeneralDirectPosition
final public double[] ordinates(Code)(Java Doc)

Methods inherited from org.geotools.geometry.GeneralDirectPosition
public Object clone()(Code)(Java Doc)
final public CoordinateReferenceSystem getCoordinateReferenceSystem()(Code)(Java Doc)
final public double[] getCoordinates()(Code)(Java Doc)
final public int getDimension()(Code)(Java Doc)
final public double getOrdinate(int dimension) throws IndexOutOfBoundsException(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
static int hashCode(double[] ordinates)(Code)(Java Doc)
public void setCoordinateReferenceSystem(CoordinateReferenceSystem crs) throws MismatchedDimensionException(Code)(Java Doc)
final public void setLocation(DirectPosition position) throws MismatchedDimensionException(Code)(Java Doc)
final public void setLocation(GeneralDirectPosition position) throws MismatchedDimensionException(Code)(Java Doc)
final public void setLocation(Point2D point) throws MismatchedDimensionException(Code)(Java Doc)
final public void setOrdinate(int dimension, double value) throws IndexOutOfBoundsException(Code)(Java Doc)
public Point2D toPoint2D() throws IllegalStateException(Code)(Java Doc)
public static String toString(DirectPosition position)(Code)(Java Doc)

Methods inherited from org.geotools.geometry.AbstractDirectPosition
static void checkCoordinateReferenceSystemDimension(CoordinateReferenceSystem crs, int expected) throws MismatchedDimensionException(Code)(Java Doc)
public Object clone()(Code)(Java Doc)
static void ensureDimensionMatch(String name, int dimension, int expectedDimension) throws MismatchedDimensionException(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
public double[] getCoordinates()(Code)(Java Doc)
public DirectPosition getPosition()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
static int hashCode(DirectPosition position)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
static String toString(DirectPosition position)(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.