org.geotools.cs
Class GeodeticCalculator

java.lang.Object
  extended byorg.geotools.cs.GeodeticCalculator

Deprecated. Replaced by GeodeticCalculator.

public class GeodeticCalculator
extends java.lang.Object

Performs geodetic calculations on an ellipsoid. This class encapsulate a generic ellipsoid and calculate the following properties:


Note: This class is not thread-safe. If geodetic calculations are needed in a multi-threads environment, create one instance of GeodeticCalculator for each thread even if the computations are performed with the same ellipsoid.

Version:
$Id: GeodeticCalculator.java 11002 2005-02-02 03:45:45Z desruisseaux $
Author:
Daniele Franzoni, Martin Desruisseaux

Constructor Summary
GeodeticCalculator()
          Deprecated. Constructs a new geodetic calculator associated with the WGS84 ellipsoid.
GeodeticCalculator(Ellipsoid ellipsoid)
          Deprecated. Constructs a new geodetic calculator associated with the specified ellipsoid.
 
Method Summary
 java.awt.geom.Point2D getAnchorPoint()
          Deprecated. Returns the anchor point.
 double getAzimuth()
          Deprecated. Returns the azimuth.
 java.awt.geom.Point2D getDestinationPoint()
          Deprecated. Returns the destination point.
 Ellipsoid getEllipsoid()
          Deprecated. Return the referenced ellipsoid.
 java.awt.Shape getGeodeticCurve()
          Deprecated. Calculates the geodetic curve between two points in the referenced ellipsoid.
 java.awt.Shape getGeodeticCurve(int numberOfPoints)
          Deprecated. Calculates the geodetic curve between two points in the referenced ellipsoid.
 double getMeridianArcLength(double latitude1, double latitude2)
          Deprecated. Calculate the meridian arc length between two points in the same meridian in the referenced ellipsoid.
 double getOrthodromicDistance()
          Deprecated. Returns the orthodromic distance.
 void setAnchorPoint(double longitude, double latitude)
          Deprecated. Set the anchor point.
 void setAnchorPoint(java.awt.geom.Point2D point)
          Deprecated. Set the anchor point.
 void setDestinationPoint(double longitude, double latitude)
          Deprecated. Set the destination point.
 void setDestinationPoint(java.awt.geom.Point2D point)
          Deprecated. Set the destination point.
 void setDirection(double azimuth, double distance)
          Deprecated. Set the azimuth and the distance from the anchor point.
static com.vividsolutions.jts.geom.Geometry shapeToGeometry(java.awt.Shape shape, com.vividsolutions.jts.geom.GeometryFactory factory)
          Deprecated. Convert an arbitrary Java2D shape into a JTS geometry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeodeticCalculator

public GeodeticCalculator()
Deprecated. 
Constructs a new geodetic calculator associated with the WGS84 ellipsoid.


GeodeticCalculator

public GeodeticCalculator(Ellipsoid ellipsoid)
Deprecated. 
Constructs a new geodetic calculator associated with the specified ellipsoid. All calculations done by the new instance are referenced to the ellipsoid specified.

Parameters:
ellipsoid - The reference to the ellipsoid onto which calculates distances and azimuths.
Method Detail

getEllipsoid

public Ellipsoid getEllipsoid()
Deprecated. 
Return the referenced ellipsoid.

Returns:
The referenced ellipsoid.

setAnchorPoint

public void setAnchorPoint(double longitude,
                           double latitude)
                    throws java.lang.IllegalArgumentException
Deprecated. 
Set the anchor point. The azimuth, the orthodromic distance and the destination point are discarted. They will need to be specified again.

Parameters:
longitude - The longitude in degrees between -180 and +180?
latitude - The latitude in degrees between -90 and +90?
Throws:
java.lang.IllegalArgumentException - if the longitude or the latitude is out of bounds.

setAnchorPoint

public void setAnchorPoint(java.awt.geom.Point2D point)
                    throws java.lang.IllegalArgumentException
Deprecated. 
Set the anchor point. The x and y coordinates must be the longitude and latitude in degrees, respectively. This is a convenience method for setAnchorPoint(x,y).

Parameters:
point - The anchor point.
Throws:
java.lang.IllegalArgumentException - if the longitude or the latitude is out of bounds.

getAnchorPoint

public java.awt.geom.Point2D getAnchorPoint()
Deprecated. 
Returns the anchor point. The x and y coordinates are the longitude and latitude in degrees, respectively. If the anchor point has never been set, then the default value is (0,0).

Returns:
The anchor point.

setDestinationPoint

public void setDestinationPoint(double longitude,
                                double latitude)
                         throws java.lang.IllegalArgumentException
Deprecated. 
Set the destination point. The azimuth and distance values will be updated as a side effect of this call. They will be recomputed the next time getAzimuth() or getOrthodromicDistance() are invoked.

Parameters:
longitude - The longitude in degrees between -180 and +180?
latitude - The latgitude in degrees between -90 and +90?
Throws:
java.lang.IllegalArgumentException - if the longitude or the latitude is out of bounds.

setDestinationPoint

public void setDestinationPoint(java.awt.geom.Point2D point)
                         throws java.lang.IllegalArgumentException
Deprecated. 
Set the destination point. The x and y coordinates must be the longitude and latitude in degrees, respectively. This is a convenience method for setDestinationPoint(x,y).

Parameters:
point - The destination point.
Throws:
java.lang.IllegalArgumentException - if the longitude or the latitude is out of bounds.

getDestinationPoint

public java.awt.geom.Point2D getDestinationPoint()
                                          throws java.lang.IllegalStateException
Deprecated. 
Returns the destination point. This method returns the point set by the last call to a setDestinationPoint(...) method, except if setDirection(...) has been invoked after. In this later case, the destination point will be computed from the anchor point to the azimuth and distance specified.

Returns:
The destination point. The x and y coordinates are the longitude and latitude in degrees, respectively.
Throws:
java.lang.IllegalStateException - if the azimuth and the distance have not been set.

setDirection

public void setDirection(double azimuth,
                         double distance)
                  throws java.lang.IllegalArgumentException
Deprecated. 
Set the azimuth and the distance from the anchor point. The destination point will be updated as a side effect of this call. It will be recomputed the next time getDestinationPoint() is invoked.

Parameters:
azimuth - The azimuth in degrees from -180? to 180?.
distance - The orthodromic distance in the same units as the ellipsoid axis.
Throws:
java.lang.IllegalArgumentException - if the azimuth or the distance is out of bounds.
See Also:
getAzimuth(), getOrthodromicDistance()

getAzimuth

public double getAzimuth()
                  throws java.lang.IllegalStateException
Deprecated. 
Returns the azimuth. This method returns the value set by the last call to setDirection(azimuth,distance), except if setDestinationPoint(...) has been invoked after. In this later case, the azimuth will be computed from the anchor point to the destination point.

Returns:
The azimuth, in degrees from -180? to +180?.
Throws:
java.lang.IllegalStateException - if the destination point has not been set.

getOrthodromicDistance

public double getOrthodromicDistance()
                              throws java.lang.IllegalStateException
Deprecated. 
Returns the orthodromic distance. This method returns the value set by the last call to setDirection(azimuth,distance), except if setDestinationPoint(...) has been invoked after. In this later case, the distance will be computed from the anchor point to the destination point.

Returns:
The orthodromic distance, in the same units as the ellipsoid axis.
Throws:
java.lang.IllegalStateException - if the destination point has not been set.

getMeridianArcLength

public double getMeridianArcLength(double latitude1,
                                   double latitude2)
Deprecated. 
Calculate the meridian arc length between two points in the same meridian in the referenced ellipsoid.

Parameters:
latitude1 - The latitude of the first point (in degrees).
latitude2 - The latitude of the second point (in degrees).
Returns:
Returned the meridian arc length between latitude1 and latitude2

getGeodeticCurve

public java.awt.Shape getGeodeticCurve(int numberOfPoints)
Deprecated. 
Calculates the geodetic curve between two points in the referenced ellipsoid. A curve in the ellipsoid is a path which points contain the longitude and latitude of the points in the geodetic curve. The geodetic curve is computed from the anchor point to the destination point.

Parameters:
numberOfPoints - The number of vertex in the geodetic curve. NOTE: This argument is only a hint and may be ignored in future version (if we compute a real curve rather than a list of line segments).
Returns:
The path that represents the geodetic curve from the anchor point to the destination point.
Task:
TODO: We should check for cases where the path cross the 90?N, 90?S, 90?E or 90?W boundaries.

getGeodeticCurve

public java.awt.Shape getGeodeticCurve()
Deprecated. 
Calculates the geodetic curve between two points in the referenced ellipsoid. A curve in the ellipsoid is a path which points contain the longitude and latitude of the points in the geodetic curve. The geodetic curve is computed from the anchor point to the destination point.

Returns:
The path that represents the geodetic curve from the anchor point to the destination point.

shapeToGeometry

public static com.vividsolutions.jts.geom.Geometry shapeToGeometry(java.awt.Shape shape,
                                                                   com.vividsolutions.jts.geom.GeometryFactory factory)
Deprecated. 
Convert 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.
factory - The JTS factory to use for creating geometry.
Returns:
The JTS geometry.
Task:
REVISIT: Maybe we should move this method somewhere else (in some utility class).


Copyright © GeoTools. All Rights Reserved.