jaron.gps
Class GPSUtil

java.lang.Object
  extended by jaron.gps.GPSUtil

public class GPSUtil
extends java.lang.Object

The GPSUtil class provides some utility functionality for the GPS data handling.

Since:
1.1
Version:
1.2
Author:
jarontec gmail com

Constructor Summary
GPSUtil()
           
 
Method Summary
static double getDistance(double lat1, double lon1, double lat2, double lon2)
          Returns the distance between two locations.
static double getDistance(Latitude lat1, Longitude lon1, Latitude lat2, Longitude lon2)
          Returns the distance between two locations.
static double getDistance(Trackpoint p1, Trackpoint p2)
          Returns the distance between two locations.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GPSUtil

public GPSUtil()
Method Detail

getDistance

public static double getDistance(double lat1,
                                 double lon1,
                                 double lat2,
                                 double lon2)
Returns the distance between two locations.

Parameters:
lat1 - the latitude coordinate of the first location
lon1 - the longitude coordinate of the first location
lat2 - the latitude coordinate of the second location
lon2 - the longitude coordinate of the second location
Returns:
the calculated distance in kilometers

getDistance

public static double getDistance(Latitude lat1,
                                 Longitude lon1,
                                 Latitude lat2,
                                 Longitude lon2)
Returns the distance between two locations.

Parameters:
lat1 - a Latitude object containing the latitude coordinate of the first location
lon1 - a Latitude object containing the longitude coordinate of the first location
lat2 - a Latitude object containing the latitude coordinate of the second location
lon2 - a Latitude object containing the longitude coordinate of the second location
Returns:
the calculated distance in kilometers

getDistance

public static double getDistance(Trackpoint p1,
                                 Trackpoint p2)
Returns the distance between two locations.

Parameters:
p1 - a Trackpoint object containing the first location
p2 - a Trackpoint object containing the second location
Returns:
the calculated distance in kilometers