Project Wonder 5.0

er.extensions.components
Class ERXGMapUtilities.Coordinate

java.lang.Object
  extended by er.extensions.components.ERXGMapUtilities.Coordinate
Enclosing class:
ERXGMapUtilities

public static class ERXGMapUtilities.Coordinate
extends java.lang.Object


Field Summary
static char UNIT_KILOMETERS
           
static char UNIT_NAUTICAL_MILES
           
static char UNIT_STATUTE_MILES
           
 
Constructor Summary
ERXGMapUtilities.Coordinate(double latitude, double longitude)
           
 
Method Summary
static double distance(double lat1, double lon1, double lat2, double lon2, char unit)
          Calculate distance between two coordinates.
 double distanceTo(ERXGMapUtilities.Coordinate other, char unit)
           
 double latitude()
           
 double longitude()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

ERXGMapUtilities.Coordinate

public ERXGMapUtilities.Coordinate(double latitude,
                                   double longitude)
Method Detail

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

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.