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


java.lang.Object
   org.geotools.demo.referencing.CTSTutorial

CTSTutorial
public class CTSTutorial (Code)
Code for the geotools coordinate transformation services tutorial: http://docs.codehaus.org/display/GEOTOOLS/Coordinate+Transformation+Services+for+Geotools+2.1 The following code is made up of many, short methods used for discussion in the tutorial, and does not create a coherent program. These examples cover the following topics:
  • creating coordinate reference systems (CRS) by hand
  • creating CRS's from well known text (WKT) strings
  • creating CRS's from authority codes
  • creating math transforms between CRS's
  • creating math transforms by hand
START SNIPPET and END SNIPPET comments are used by the wiki to display code snippets from svn. Factory creation is repeated below so that it shows up in the tutorial code snippets.
version:
   $Id: CTSTutorial.java 21780 2006-10-03 21:06:21Z desruisseaux $
author:
   Rueben Schulz
author:
   TODO using the auto crs factory



Constructor Summary
 CTSTutorial()
    

Method Summary
 voidcreatCRSFromWKT()
     An example of creating a CRS from a WKT string.
 voidcreateAndUseMathTransform()
     Creates a low level math transform by hand.
 voidcreateCRSByHand1()
     Creates a WGS 84/UTM Zone 10N CRS mostly (uses some premade objects) by hand.
 voidcreateCRSByHand2()
     Creates a NAD 27 geographic CRS.
 voidcreateCRSByHand3()
     Creates two coordinate reference system by hand without using any of the GT2 APIs (except FactoryFinder to get things started).
 voidcreateFromEPSGCode()
     Creates a CRS from an EPSG code.
 voidcreateMathTransformBetweenCRSs()
     Creates a math transform between the CRS's created in createCRSByHand2() and createCRSByHand1().
 voidcreateOperationFromAuthorityCode()
    
 voidcreateTransformFromAuthorityCode()
    
 voidhintExample()
    
public static  voidmain(String[] args)
    
 voidpremadeObjects()
     A method with some examples of premade static objects.
 voidprintIdentifierStuff(IdentifiedObject identObj)
    
 voidtransformUsingCRSUtility()
     Uses the CRS utility class to create two CRSs and a tranformation between them.


Constructor Detail
CTSTutorial
CTSTutorial()(Code)




Method Detail
creatCRSFromWKT
void creatCRSFromWKT() throws Exception(Code)
An example of creating a CRS from a WKT string. Additonal examples of WKT strings can be found in http://svn.geotools.org/geotools/trunk/gt/module/referencing/test/org/geotools/referencing/test-data/ TODO Brief description of what a CRS is (and what it is composed of)
throws:
  Exception -



createAndUseMathTransform
void createAndUseMathTransform() throws FactoryException, MismatchedDimensionException, TransformException(Code)
Creates a low level math transform by hand. This is essentially just an equation (with some parameters) used to transform input to output points.
throws:
  TransformException -
throws:
  MismatchedDimensionException -



createCRSByHand1
void createCRSByHand1() throws Exception(Code)
Creates a WGS 84/UTM Zone 10N CRS mostly (uses some premade objects) by hand. Uses the higher level FactoryGroup instead of the lower level MathTransformFactory (commented out).
throws:
  Exception -



createCRSByHand2
void createCRSByHand2() throws Exception(Code)
Creates a NAD 27 geographic CRS. Notice that the datum factory automatically adds aliase names to the datum (because "North American Datum 1927" has an entry in http://svn.geotools.org/geotools/trunk/gt/module/referencing/src/org/geotools/referencing/factory/DatumAliasesTable.txt ). Also notice that toWGS84 information (used in a datum transform) was also added to the datum.



createCRSByHand3
void createCRSByHand3() throws FactoryException(Code)
Creates two coordinate reference system by hand without using any of the GT2 APIs (except FactoryFinder to get things started). It does not use any of the static objects available in geotools implementations. The following example creates a CRS to represent the Airy 1830 ellipsoid with the incoming data in the order of (long,lat,height) and a geocentric CRS with (x,y,z) axises. TODO the Airy CRS described below is actually wgs84, FIX this.
throws:
  FactoryException -



createFromEPSGCode
void createFromEPSGCode() throws Exception(Code)
Creates a CRS from an EPSG code. There are a few different EPSG authority factories in geotools that do roughly the same thing:
  • gt2-epsg-access.jar is backed by the official EPSG MS Access database (only works on MS Windows, therefore I have not shown how to configure it here).
  • gt2-epsg-hsql.jar provides an embeded hsql database created from the EPSG SQL scripts. This contains the same information as the MS Arcess database.
  • other factories allow the EPSG information to be in an external database (postgresql, mysql, oracle)
  • gt2-epsg-wkt.jar is a simple properties file with WKT descriptions for EPSG defined CRS codes. This file does not derive directly from the official EPSG database, so its should be used with caution. It provides a very simple method of creating a new authority factory and named objects.
The specific authority factory returned by getCRSAuthorityFactory is dependent on the different factories on your classpath (ie WKT or Access or HSQL) and the hints you provide. By default the "better" authority factory should be used if more than one is available. TODO check on the use of hints TODO expand on how to use EPSG data in a postgres db (this may be a 2.2 feature, but FactoryUsingANSISQL may work)



createMathTransformBetweenCRSs
void createMathTransformBetweenCRSs() throws Exception(Code)
Creates a math transform between the CRS's created in createCRSByHand2() and createCRSByHand1(). The resulting transformation is a concatenation of the following transforms:
  • Affine - to switch axis order from (latitude,longitude) to (longitude,latitude)
  • Molodenski - to preform a datum shift between NAD27 and WGS84, using the NAD 27 CRS BursaWolfParameters parameters
  • Transverse Mercator - to convert from geographic to projected UTM coordinates

throws:
  Exception -



createOperationFromAuthorityCode
void createOperationFromAuthorityCode() throws Exception(Code)

since:
   2.2
throws:
  Exception -



createTransformFromAuthorityCode
void createTransformFromAuthorityCode() throws Exception(Code)

since:
   2.2
throws:
  Exception -



hintExample
void hintExample() throws Exception(Code)



main
public static void main(String[] args)(Code)



premadeObjects
void premadeObjects()(Code)
A method with some examples of premade static objects.



printIdentifierStuff
void printIdentifierStuff(IdentifiedObject identObj)(Code)
Print out information about an identified object



transformUsingCRSUtility
void transformUsingCRSUtility() throws Exception(Code)
Uses the CRS utility class to create two CRSs and a tranformation between them.



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.