er.extensions.components
Class ERXGMapUtilities.Coordinate
java.lang.Object
er.extensions.components.ERXGMapUtilities.Coordinate
- Enclosing class:
- ERXGMapUtilities
public static class ERXGMapUtilities.Coordinate
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
UNIT_STATUTE_MILES
public static final char UNIT_STATUTE_MILES
- See Also:
- Constant Field Values
UNIT_NAUTICAL_MILES
public static final char UNIT_NAUTICAL_MILES
- See Also:
- Constant Field Values
UNIT_KILOMETERS
public static final char UNIT_KILOMETERS
- See Also:
- Constant Field Values
ERXGMapUtilities.Coordinate
public ERXGMapUtilities.Coordinate(double latitude,
double longitude)
latitude
public double latitude()
longitude
public double longitude()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
distanceTo
public double distanceTo(ERXGMapUtilities.Coordinate other,
char unit)
distance
public static double distance(double lat1,
double lon1,
double lat2,
double lon2,
char unit)
- Calculate distance between two coordinates.
South latitudes are negative, east longitudes are positive.
Based on code from http://www.zipcodeworld.com/developers.htm
- Parameters:
lat1
- Latitude of point 1 (in decimal degrees)lon1
- Longitude of point 1 (in decimal degrees)lat2
- Latitude of point 2 (in decimal degrees)lon2
- Longitude of point 2 (in decimal degrees)unit
- one of UNIT_STATUTE_MILES, UNIT_NAUTICAL_MILES or
UNIT_KILOMETERS
- Returns:
- distance between the two coordinates
Copyright © 2002 – 2007 Project Wonder.