|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.referencing.GeodeticCalculator
public class GeodeticCalculator
Performs geodetic calculations on an ellipsoid. This class encapsulates a generic ellipsoid and calculates the following properties:
The calculation use the following informations:
Note: This class is not thread-safe. If geodetic calculations are needed in a multi-threads
environment, create one distinct instance of GeodeticCalculator
for each thread.
Constructor Summary | |
---|---|
GeodeticCalculator()
Constructs a new geodetic calculator associated with the WGS84 ellipsoid. |
|
GeodeticCalculator(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Constructs a new geodetic calculator expecting coordinates in the supplied CRS. |
|
GeodeticCalculator(org.opengis.referencing.datum.Ellipsoid ellipsoid)
Constructs a new geodetic calculator associated with the specified ellipsoid. |
Method Summary | |
---|---|
double |
getAzimuth()
Returns the azimuth. |
org.opengis.referencing.crs.CoordinateReferenceSystem |
getCoordinateReferenceSystem()
Returns the coordinate reference system for all methods working on Position objects. |
java.awt.geom.Point2D |
getDestinationGeographicPoint()
Returns the destination point. |
org.opengis.geometry.DirectPosition |
getDestinationPosition()
Returns the destination position in user coordinates, which doesn't need to be geographic. |
org.opengis.referencing.datum.Ellipsoid |
getEllipsoid()
Returns the referenced ellipsoid. |
java.awt.Shape |
getGeodeticCurve()
Calculates the geodetic curve between two points in the referenced ellipsoid. |
java.awt.Shape |
getGeodeticCurve(int numberOfPoints)
Calculates the geodetic curve between two points in the referenced ellipsoid. |
org.opengis.referencing.crs.GeographicCRS |
getGeographicCRS()
Returns the geographic coordinate reference system for all methods working on Point2D objects. |
double |
getMeridianArcLength(double latitude1,
double latitude2)
Calculates the meridian arc length between two points in the same meridian in the referenced ellipsoid. |
double |
getOrthodromicDistance()
Returns the orthodromic distance. |
java.awt.geom.Point2D |
getStartingGeographicPoint()
Returns the starting point in geographic coordinates. |
org.opengis.geometry.DirectPosition |
getStartingPosition()
Returns the starting position in user coordinates, which doesn't need to be geographic. |
void |
setDestinationGeographicPoint(double longitude,
double latitude)
Set the destination point in geographic coordinates. |
void |
setDestinationGeographicPoint(java.awt.geom.Point2D point)
Set the destination point in geographic coordinates. |
void |
setDestinationPosition(org.opengis.geometry.coordinate.Position position)
Set the destination position in user coordinates, which doesn't need to be geographic. |
void |
setDirection(double azimuth,
double distance)
Set the azimuth and the distance from the starting point. |
void |
setStartingGeographicPoint(double longitude,
double latitude)
Set the starting point in geographic coordinates. |
void |
setStartingGeographicPoint(java.awt.geom.Point2D point)
Set the starting point in geographic coordinates. |
void |
setStartingPosition(org.opengis.geometry.coordinate.Position position)
Set the starting position in user coordinates, which doesn't need to be geographic. |
java.lang.String |
toString()
Returns a string representation of the current state of this calculator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GeodeticCalculator()
public GeodeticCalculator(org.opengis.referencing.datum.Ellipsoid ellipsoid)
ellipsoid
- The ellipsoid onto which calculates distances and azimuths.public GeodeticCalculator(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
crs
- The reference system for the Position
objects.Method Detail |
---|
public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
Position
objects.
This is the CRS specified at construction time.
Position
s.public org.opengis.referencing.crs.GeographicCRS getGeographicCRS()
Point2D
objects. This is inferred from the CRS specified at
construction time.
Point2D
s.public org.opengis.referencing.datum.Ellipsoid getEllipsoid()
public void setStartingGeographicPoint(double longitude, double latitude) throws java.lang.IllegalArgumentException
longitude
- The longitude in decimal degrees between -180 and +180°latitude
- The latitude in decimal degrees between -90 and +90°
java.lang.IllegalArgumentException
- if the longitude or the latitude is out of bounds.public void setStartingGeographicPoint(java.awt.geom.Point2D point) throws java.lang.IllegalArgumentException
setStartingGeographicPoint(x,y)
.
point
- The starting point.
java.lang.IllegalArgumentException
- if the longitude or the latitude is out of bounds.public void setStartingPosition(org.opengis.geometry.coordinate.Position position) throws org.opengis.referencing.operation.TransformException
position
- The position in user coordinate reference system.
org.opengis.referencing.operation.TransformException
- if the position can't be transformed.public java.awt.geom.Point2D getStartingGeographicPoint()
public org.opengis.geometry.DirectPosition getStartingPosition() throws org.opengis.referencing.operation.TransformException
org.opengis.referencing.operation.TransformException
- if the position can't be transformed to user coordinates.public void setDestinationGeographicPoint(double longitude, double latitude) throws java.lang.IllegalArgumentException
getAzimuth()
or getOrthodromicDistance()
are invoked.
longitude
- The longitude in decimal degrees between -180 and +180°latitude
- The latgitude in decimal degrees between -90 and +90°
java.lang.IllegalArgumentException
- if the longitude or the latitude is out of bounds.public void setDestinationGeographicPoint(java.awt.geom.Point2D point) throws java.lang.IllegalArgumentException
setDestinationGeographicPoint(x,y)
.
point
- The destination point.
java.lang.IllegalArgumentException
- if the longitude or the latitude is out of bounds.public void setDestinationPosition(org.opengis.geometry.coordinate.Position position) throws org.opengis.referencing.operation.TransformException
position
- The position in user coordinate reference system.
org.opengis.referencing.operation.TransformException
- if the position can't be transformed.public java.awt.geom.Point2D getDestinationGeographicPoint() throws java.lang.IllegalStateException
setDestinationGeographicPoint(...)
method, except if
setDirection(...)
has been
invoked after. In this later case, the destination point will be computed from the
starting point to the azimuth and distance
specified.
java.lang.IllegalStateException
- if the azimuth and the distance have not been set.public org.opengis.geometry.DirectPosition getDestinationPosition() throws org.opengis.referencing.operation.TransformException
org.opengis.referencing.operation.TransformException
- if the position can't be transformed to user coordinates.public void setDirection(double azimuth, double distance) throws java.lang.IllegalArgumentException
getDestinationGeographicPoint()
is invoked.
azimuth
- The azimuth in decimal degrees from -180° to 180°.distance
- The orthodromic distance in the same units as the
ellipsoid axis.
java.lang.IllegalArgumentException
- if the azimuth or the distance is out of bounds.getAzimuth()
,
getOrthodromicDistance()
public double getAzimuth() throws java.lang.IllegalStateException
setDirection(azimuth,distance)
,
except if setDestinationGeographicPoint(...)
has been invoked after. In this later case, the
azimuth will be computed from the starting point
to the destination point.
java.lang.IllegalStateException
- if the destination point has not been set.public double getOrthodromicDistance() throws java.lang.IllegalStateException
setDirection(azimuth,distance)
,
except if setDestinationGeographicPoint(...)
has been invoked after. In this later case, the
distance will be computed from the starting point
to the destination point.
java.lang.IllegalStateException
- if the destination point has not been set.public double getMeridianArcLength(double latitude1, double latitude2)
latitude1
- The latitude of the first point (in decimal degrees).latitude2
- The latitude of the second point (in decimal degrees).
public java.awt.Shape getGeodeticCurve(int numberOfPoints)
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).
public java.awt.Shape getGeodeticCurve()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |