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


java.lang.Object
   org.geotools.geometry.jts.JTS

JTS
final public class JTS (Code)
JTS Geometry utility methods, bringing Geotools to JTS.

Offers geotools based services such as reprojection.

Responsibilities:

  • transformation
  • coordinate sequence editing
  • common coordinate sequence implementations for specific uses

since:
   2.2
version:
   $Id: JTS.java 26970 2007-09-14 14:05:43Z aaime $
author:
   Jody Garnett
author:
   Martin Desruisseaux
author:
   Simone Giannecchini




Method Summary
public static  voidcheckCoordinatesRange(Geometry geom, CoordinateReferenceSystem crs)
     Checks a Geometry coordinates are within the area of validity of the specified reference system.
public static  voidcopy(Coordinate point, double[] ordinates)
     Copies the ordinates values from the specified JTS coordinates to the specified array.
public static  Envelope2DgetEnvelope2D(Envelope envelope, CoordinateReferenceSystem crs)
     Converts a JTS 2D envelope in an Envelope2D for interoperability with the referencing package.

If the provided envelope is a ReferencedEnvelope we check that the provided CRS and the implicit CRS are similar.
Parameters:
  envelope - The JTS envelope to convert.
Parameters:
  crs - The coordinate reference system for the specified envelope.

public static synchronized  doubleorthodromicDistance(Coordinate p1, Coordinate p2, CoordinateReferenceSystem crs)
     Computes the orthodromic distance between two points.
public static  GeometryshapeToGeometry(Shape shape, GeometryFactory factory)
     Converts an arbitrary Java2D shape into a JTS geometry.
public static  EnvelopetoGeographic(Envelope envelope, CoordinateReferenceSystem crs)
     Transforms the envelope from its current crs to WGS84 coordinate reference system. If the specified envelope is already in WGS84, then it is returned unchanged.
Parameters:
  envelope - The envelope to transform.
Parameters:
  crs - The CRS the envelope is currently in.
public static  PolygontoGeometry(Envelope e)
     Converts an envelope to a polygon.

The resulting polygon contains an outer ring with verticies: (x1,y1),(x2,y1),(x2,y2),(x1,y2),(x1,y1)
Parameters:
  envelope - The original envelope.

public static  Envelopetransform(Envelope envelope, MathTransform transform)
     Transforms the envelope using the specified math transform. Note that this method can not handle the case where the envelope contains the North or South pole, or when it cross the ±180� longitude, because do not carry suffisient informations.
public static  Envelopetransform(Envelope sourceEnvelope, Envelope targetEnvelope, MathTransform transform, int npoints)
     Transforms the densified envelope using the specified math transform. The envelope is densified (extra points put around the outside edge) to provide a better new envelope for high deformed situations.

If an optional target envelope is provided, this envelope will be with the transformation result.

public static  Geometrytransform(Geometry geom, MathTransform transform)
     Transforms the geometry using the default transformer.
Parameters:
  geom - The geom to transform
Parameters:
  transform - the transform to use during the transformation.
public static  Coordinatetransform(Coordinate source, Coordinate dest, MathTransform transform)
     Transforms the coordinate using the provided math transform.
Parameters:
  source - the source coordinate that will be transformed
Parameters:
  dest - the coordinate that will be set.
public static  voidxform(MathTransform transform, double[] src, double[] dest)
     Like a transform but eXtreme! Transforms an array of coordinates using the provided math transform. Each coordinate is transformed separately.



Method Detail
checkCoordinatesRange
public static void checkCoordinatesRange(Geometry geom, CoordinateReferenceSystem crs) throws PointOutsideEnvelopeException(Code)
Checks a Geometry coordinates are within the area of validity of the specified reference system. If a coordinate falls outside the area of validity a PointOutsideEnvelopeException is thrown
Parameters:
  geom - the geometry to check
Parameters:
  the - crs that defines the are of validity (must not be null)
throws:
  PointOutsideEnvelopeException -
since:
   2.4



copy
public static void copy(Coordinate point, double[] ordinates)(Code)
Copies the ordinates values from the specified JTS coordinates to the specified array. The destination array can have any length. Only the relevant field of the source coordinate will be copied. If the array length is greater than 3, then all extra dimensions will be set to Double.NaN NaN .
Parameters:
  point - The source coordinate.
Parameters:
  ordinates - The destination array.



getEnvelope2D
public static Envelope2D getEnvelope2D(Envelope envelope, CoordinateReferenceSystem crs) throws MismatchedDimensionException(Code)
Converts a JTS 2D envelope in an Envelope2D for interoperability with the referencing package.

If the provided envelope is a ReferencedEnvelope we check that the provided CRS and the implicit CRS are similar.
Parameters:
  envelope - The JTS envelope to convert.
Parameters:
  crs - The coordinate reference system for the specified envelope. The GeoAPI envelope.
throws:
  MismatchedDimensionException - if a two-dimensional envelope can't be createdfrom an envelope with the specified CRS.
since:
   2.3




orthodromicDistance
public static synchronized double orthodromicDistance(Coordinate p1, Coordinate p2, CoordinateReferenceSystem crs) throws TransformException(Code)
Computes the orthodromic distance between two points. This method:

  1. Transforms both points to geographic coordinates (latitude,longitude).
  2. Computes the orthodromic distance between the two points using ellipsoidal calculations.

The real work is performed by GeodeticCalculator . This convenience method simply manages a pool of pre-defined geodetic calculators for the given coordinate reference system in order to avoid repetitive object creation. If a large amount of orthodromic distances need to be computed, direct use of GeodeticCalculator provides better performance than this convenience method.
Parameters:
  p1 - First point
Parameters:
  p2 - Second point
Parameters:
  crs - Reference system the two points are in. Orthodromic distance between the two points, in meters.
throws:
  TransformException - if the coordinates can't be transformed from the specifiedCRS to a .




shapeToGeometry
public static Geometry shapeToGeometry(Shape shape, GeometryFactory factory)(Code)
Converts an arbitrary Java2D shape into a JTS geometry. The created JTS geometry may be any of LineString , LinearRing or MultiLineString .
Parameters:
  shape - The Java2D shape to create.
Parameters:
  factory - The JTS factory to use for creating geometry. The JTS geometry.



toGeographic
public static Envelope toGeographic(Envelope envelope, CoordinateReferenceSystem crs) throws TransformException(Code)
Transforms the envelope from its current crs to WGS84 coordinate reference system. If the specified envelope is already in WGS84, then it is returned unchanged.
Parameters:
  envelope - The envelope to transform.
Parameters:
  crs - The CRS the envelope is currently in. The envelope transformed to be in WGS84 CRS.
throws:
  TransformException - If at least one coordinate can't be transformed.



toGeometry
public static Polygon toGeometry(Envelope e)(Code)
Converts an envelope to a polygon.

The resulting polygon contains an outer ring with verticies: (x1,y1),(x2,y1),(x2,y2),(x1,y2),(x1,y1)
Parameters:
  envelope - The original envelope. The envelope as a polygon.
since:
   2.4




transform
public static Envelope transform(Envelope envelope, MathTransform transform) throws TransformException(Code)
Transforms the envelope using the specified math transform. Note that this method can not handle the case where the envelope contains the North or South pole, or when it cross the ±180� longitude, because do not carry suffisient informations. For a more robust envelope transformation, use ReferencedEnvelope.transform(CoordinateReferenceSystemboolean) instead.
Parameters:
  envelope - The envelope to transform.
Parameters:
  transform - The transform to use. The transformed Envelope
throws:
  TransformException - if at least one coordinate can't be transformed.



transform
public static Envelope transform(Envelope sourceEnvelope, Envelope targetEnvelope, MathTransform transform, int npoints) throws TransformException(Code)
Transforms the densified envelope using the specified math transform. The envelope is densified (extra points put around the outside edge) to provide a better new envelope for high deformed situations.

If an optional target envelope is provided, this envelope will be with the transformation result. It will not be before the expansion.

Note that this method can not handle the case where the envelope contains the North or South pole, or when it cross the ±180� longitude, because do not carry suffisient informations. For a more robust envelope transformation, use ReferencedEnvelope.transform(CoordinateReferenceSystembooleanint) instead.
Parameters:
  sourceEnvelope - The envelope to transform.
Parameters:
  targetEnvelope - An envelope to expand with the transformation result, or null for returning an new envelope.
Parameters:
  transform - The transform to use.
Parameters:
  npoints - Densification of each side of the rectange. targetEnvelope if it was non-null, or a new envelope otherwise.In all case, the returned envelope fully contains the transformed envelope.
throws:
  TransformException - if a coordinate can't be transformed.




transform
public static Geometry transform(Geometry geom, MathTransform transform) throws MismatchedDimensionException, TransformException(Code)
Transforms the geometry using the default transformer.
Parameters:
  geom - The geom to transform
Parameters:
  transform - the transform to use during the transformation. the transformed geometry. It will be a new geometry.
throws:
  MismatchedDimensionException - if the geometry doesn't have the expected dimensionfor the specified transform.
throws:
  TransformException - if a point can't be transformed.



transform
public static Coordinate transform(Coordinate source, Coordinate dest, MathTransform transform) throws TransformException(Code)
Transforms the coordinate using the provided math transform.
Parameters:
  source - the source coordinate that will be transformed
Parameters:
  dest - the coordinate that will be set. May be null or the source coordinate(or new coordinate of course). the destination coordinate if not null or a new Coordinate.
throws:
  TransformException - if the coordinate can't be transformed.



xform
public static void xform(MathTransform transform, double[] src, double[] dest) throws TransformException(Code)
Like a transform but eXtreme! Transforms an array of coordinates using the provided math transform. Each coordinate is transformed separately. In case of a transform exception then the new value of the coordinate is the last coordinate correctly transformed.
Parameters:
  transform - The math transform to apply.
Parameters:
  src - The source coordinates.
Parameters:
  dest - The destination array for transformed coordinates.
throws:
  TransformException - if this method failed to transform any of the points.



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.