|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.referencing.GeodeticCalculator
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 distinct instance of 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 | |
java.awt.geom.Point2D |
getAnchorPoint()
Returns the anchor point. |
org.opengis.spatialschema.geometry.DirectPosition |
getAnchorPosition()
Returns the anchor position in user coordinates, which doesn't need to be geographic. |
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 |
getDestinationPoint()
Returns the destination point. |
org.opengis.spatialschema.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. |
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. |
void |
setAnchorPoint(double longitude,
double latitude)
Set the anchor point. |
void |
setAnchorPoint(java.awt.geom.Point2D point)
Set the anchor point. |
void |
setAnchorPosition(org.opengis.spatialschema.geometry.geometry.Position position)
Set the anchor position in user coordinates, which doesn't need to be geographic. |
void |
setDestinationPoint(double longitude,
double latitude)
Set the destination point. |
void |
setDestinationPoint(java.awt.geom.Point2D point)
Set the destination point. |
void |
setDestinationPosition(org.opengis.spatialschema.geometry.geometry.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 anchor point. |
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 reference to the ellipsoid onto which calculates distances and azimuths.public GeodeticCalculator(org.opengis.referencing.crs.CoordinateReferenceSystem crs) throws org.opengis.referencing.FactoryException
crs
- The reference system for the Position
objects.
org.opengis.referencing.FactoryException
- if no transform to a geodetic CRS can be created
for the specified CRS.Method Detail |
public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
Position
objects.
This is the CRS specified at construction time.
public org.opengis.referencing.datum.Ellipsoid getEllipsoid()
public void setAnchorPoint(double longitude, double latitude) throws java.lang.IllegalArgumentException
longitude
- The longitude in degrees between -180 and +180?latitude
- The latitude in degrees between -90 and +90?
java.lang.IllegalArgumentException
- if the longitude or the latitude is out of bounds.public void setAnchorPoint(java.awt.geom.Point2D point) throws java.lang.IllegalArgumentException
setAnchorPoint(x,y)
.
point
- The anchor point.
java.lang.IllegalArgumentException
- if the longitude or the latitude is out of bounds.public void setAnchorPosition(org.opengis.spatialschema.geometry.geometry.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 getAnchorPoint()
public org.opengis.spatialschema.geometry.DirectPosition getAnchorPosition() throws org.opengis.referencing.operation.TransformException
org.opengis.referencing.operation.TransformException
- if the position can't be transformed to user coordinates.public void setDestinationPoint(double longitude, double latitude) throws java.lang.IllegalArgumentException
getAzimuth()
or
getOrthodromicDistance()
are invoked.
longitude
- The longitude in degrees between -180 and +180?latitude
- The latgitude in degrees between -90 and +90?
java.lang.IllegalArgumentException
- if the longitude or the latitude is out of bounds.public void setDestinationPoint(java.awt.geom.Point2D point) throws java.lang.IllegalArgumentException
setDestinationPoint(x,y)
.
point
- The destination point.
java.lang.IllegalArgumentException
- if the longitude or the latitude is out of bounds.public void setDestinationPosition(org.opengis.spatialschema.geometry.geometry.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 getDestinationPoint() throws java.lang.IllegalStateException
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.
java.lang.IllegalStateException
- if the azimuth and the distance have not been set.public org.opengis.spatialschema.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
getDestinationPoint()
is invoked.
azimuth
- The azimuth in 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
setDestinationPoint(...)
has been invoked after. In this later case, the azimuth will be computed from the
anchor 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
setDestinationPoint(...)
has been invoked after. In this later case, the distance will be computed from the
anchor 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 degrees).latitude2
- The latitude of the second point (in 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()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |