geo.google.datamodel
Class GeoCoordinate

java.lang.Object
  extended by geo.google.datamodel.GeoCoordinate
All Implemented Interfaces:
Serializable, Cloneable

public class GeoCoordinate
extends Object
implements Serializable, Cloneable

A geographic location defined by longitude, latitude, and (optional) altitude. http://code.google.com/apis/kml/documentation/kml_tags_21.html

Author:
jliang
See Also:
Serialized Form

Constructor Summary
GeoCoordinate()
           
GeoCoordinate(double longitude, double latitude, GeoAltitude altitude)
           
 
Method Summary
 GeoCoordinate clone()
           
 double distanceTo(GeoCoordinate other)
          Returns the distance (in miles) between this geo coordinate and another geo coordinate.
 boolean equals(Object o)
           
 GeoAltitude getAltitude()
          Altitude in meters above sea level.
 double getLatitude()
           
 double getLongitude()
           
 int hashCode()
           
 void setAltitude(GeoAltitude altitude)
           
 void setLatitude(double latitude)
           
 void setLongitude(double longitude)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GeoCoordinate

public GeoCoordinate()

GeoCoordinate

public GeoCoordinate(double longitude,
                     double latitude,
                     GeoAltitude altitude)
Method Detail

getLatitude

public double getLatitude()

setLatitude

public void setLatitude(double latitude)

getLongitude

public double getLongitude()

setLongitude

public void setLongitude(double longitude)

getAltitude

public GeoAltitude getAltitude()
Altitude in meters above sea level.

Returns:

setAltitude

public void setAltitude(GeoAltitude altitude)

distanceTo

public double distanceTo(GeoCoordinate other)
Returns the distance (in miles) between this geo coordinate and another geo coordinate. (This uses spherical law of cosines formula in GeoUtils )
Note the altitude is not being considered.


clone

public GeoCoordinate clone()
Overrides:
clone in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008. All Rights Reserved.