Class Position
java.lang.Object
org.osgi.util.position.Position
Position represents a geographic location, based on the WGS84 System (World
Geodetic System 1984).
The org.osgi.util.measurement.Measurement class is used to
represent the values that make up a position.
A given position object may lack any of it's components, i.e. the altitude may not be known. Such missing values will be represented by null.
Position does not override the implementation of either equals() or
hashCode() because it is not clear how missing values should be handled. It
is up to the user of a position to determine how best to compare two position
objects. A Position object is immutable.
- Version:
- $Revision: 6860 $
-
Constructor Summary
ConstructorsConstructorDescriptionPosition(Measurement lat, Measurement lon, Measurement alt, Measurement speed, Measurement track) Constructs aPositionobject with the given values. -
Method Summary
Modifier and TypeMethodDescriptionReturns the altitude of this position in meters.Returns the latitude of this position in radians.Returns the longitude of this position in radians.getSpeed()Returns the ground speed of this position in meters per second.getTrack()Returns the track of this position in radians as a compass heading.
-
Constructor Details
-
Position
public Position(Measurement lat, Measurement lon, Measurement alt, Measurement speed, Measurement track) Constructs aPositionobject with the given values.- Parameters:
lat- aMeasurementobject specifying the latitude in radians, or nulllon- aMeasurementobject specifying the longitude in radians, or nullalt- aMeasurementobject specifying the altitude in meters, or nullspeed- aMeasurementobject specifying the speed in meters per second, or nulltrack- aMeasurementobject specifying the track in radians, or null
-
-
Method Details
-
getAltitude
Returns the altitude of this position in meters.- Returns:
- a
Measurementobject inUnit.mrepresenting the altitude in meters above the ellipsoidnullif the altitude is not known.
-
getLongitude
Returns the longitude of this position in radians.- Returns:
- a
Measurementobject inUnit.radrepresenting the longitude, ornullif the longitude is not known.
-
getLatitude
Returns the latitude of this position in radians.- Returns:
- a
Measurementobject inUnit.radrepresenting the latitude, ornullif the latitude is not known..
-
getSpeed
Returns the ground speed of this position in meters per second.- Returns:
- a
Measurementobject inUnit.m_srepresenting the speed, ornullif the speed is not known..
-
getTrack
Returns the track of this position in radians as a compass heading. The track is the extrapolation of previous previously measured positions to a future position.- Returns:
- a
Measurementobject inUnit.radrepresenting the track, ornullif the track is not known..
-