public class GeoPoint extends java.lang.Object implements java.lang.Comparable<GeoPoint>, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
int |
latitudeE6
The latitude value of this GeoPoint in microdegrees (degrees * 10^6).
|
int |
longitudeE6
The longitude value of this GeoPoint in microdegrees (degrees * 10^6).
|
| Constructor and Description |
|---|
GeoPoint(double lat,
double lon) |
GeoPoint(int latitudeE6,
int longitudeE6) |
| Modifier and Type | Method and Description |
|---|---|
double |
bearingTo(GeoPoint other) |
int |
compareTo(GeoPoint geoPoint) |
GeoPoint |
destinationPoint(double distance,
float bearing)
Returns the destination point from this point having travelled the given distance on the
given initial bearing (bearing normally varies around path followed).
|
double |
distance(GeoPoint other)
Calculate the Euclidean distance from this point to another using the Pythagorean theorem.
|
boolean |
equals(java.lang.Object obj) |
double |
getLatitude() |
double |
getLongitude() |
int |
hashCode() |
static double |
latitudeDistance(int meters)
Calculates the amount of degrees of latitude for a given distance in meters.
|
static double |
longitudeDistance(int meters,
double latitude)
Calculates the amount of degrees of longitude for a given distance in meters.
|
void |
project(Point out) |
double |
sphericalDistance(GeoPoint other)
Calculate the spherical distance from this point to another using the Haversine formula.
|
java.lang.String |
toString() |
double |
vincentyDistance(GeoPoint other)
Calculate the spherical distance from this point to another using Vincenty inverse formula
for ellipsoids.
|
public final int latitudeE6
public final int longitudeE6
public GeoPoint(double lat,
double lon)
lat - the latitude in degrees, will be limited to the possible
latitude range.lon - the longitude in degrees, will be limited to the possible
longitude range.public GeoPoint(int latitudeE6,
int longitudeE6)
latitudeE6 - the latitude in microdegrees (degrees * 10^6), will be limited
to the possible latitude range.longitudeE6 - the longitude in microdegrees (degrees * 10^6), will be
limited to the possible longitude range.public double bearingTo(GeoPoint other)
public int compareTo(GeoPoint geoPoint)
compareTo in interface java.lang.Comparable<GeoPoint>public GeoPoint destinationPoint(double distance, float bearing)
distance - the distance travelled, in same units as earth radius (default: meters)bearing - the initial bearing in degrees from northpublic double distance(GeoPoint other)
other - The point to calculate the distance topublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic double getLatitude()
public double getLongitude()
public int hashCode()
hashCode in class java.lang.Objectpublic static double latitudeDistance(int meters)
meters - distance in meterspublic static double longitudeDistance(int meters,
double latitude)
meters - distance in meterslatitude - the latitude at which the calculation should be performedpublic void project(Point out)
public double sphericalDistance(GeoPoint other)
other - The point to calculate the distance topublic java.lang.String toString()
toString in class java.lang.Objectpublic double vincentyDistance(GeoPoint other)
other - The point to calculate the distance to