|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.divbyzero.gpx.Waypoint
public class Waypoint
Way point for the GPS tracks.
Way points represent the smallest unit of which GPS track are composed. They are made up of a coordinate, a time stamp, an optional name and an elevation.
Constructor Summary | |
---|---|
Waypoint()
|
Method Summary | |
---|---|
double |
calculateDistanceTo(Waypoint otherPoint)
Calculates the distance between this way point and another one |
Coordinate |
getCoordinate()
Returns the coordinate of the way point |
double |
getElevation()
Returns the elevation of the way point |
String |
getName()
Returns the name of the way point. |
Date |
getTime()
Returns the time stamp of the way point. |
void |
setCoordinate(Coordinate coordinate)
Sets the coordinate of the way point. |
void |
setElevation(double elevation)
Sets the elevation of the way point in meters |
void |
setName(String name)
Sets the name of the way point. |
void |
setTime(Date time)
Sets the time stamp of the way point. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Waypoint()
Method Detail |
---|
public void setTime(Date time)
The time stamp denotes the point in time when a way point was recorded. The library does not assume anything regarding the use of time zones. Instead time stamps are accepted "as is".
time
- the time stamp of the way pointpublic Date getTime()
public void setCoordinate(Coordinate coordinate)
coordinate
- the coordinate of the way pointpublic Coordinate getCoordinate()
public void setName(String name)
Optionally a way point can be label with a name in order to describe it further.
name
- the name of the waypointpublic String getName()
public void setElevation(double elevation)
Internally the library expects the elevation to be in meters instead of feet or anything else. No conversion is applied to ensure this though.
elevation
- the way point's elevation in meterspublic double getElevation()
public double calculateDistanceTo(Waypoint otherPoint)
In order to calculate the distance, the Spherical Law of Cosines is used. An equatorial radius of 6,378.137 kilometers is assumed.
otherPoint
- The other way point
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |