public interface GeospatialPoint
Modifier and Type | Field and Description |
---|---|
static double |
EARTH_RADIUS
The radius of the earth in meters; all implementing whose distance
calculations rely upon the radius of the earth should reference this
value.
|
Modifier and Type | Method and Description |
---|---|
double |
getDistanceTo(double latitude,
double longitude)
Calculates the "great circle" or orthometric distance between this
point and another point on the earth's surface.
|
double |
getDistanceTo(GeospatialPoint otherPoint)
Calculates the "great circle" or orthometric distance between this
point and another point on the earth's surface.
|
double |
getLatitude()
Returns the latitude of this point.
|
double |
getLongitude()
Returns the longitude of this point.
|
static final double EARTH_RADIUS
The radius of the earth in meters; all implementing whose distance calculations rely upon the radius of the earth should reference this value.
The earth, for the purposes of this library, is considered to be a sphere with a radius of 6371000.0 meters.
double getLatitude()
double getLongitude()
double getDistanceTo(GeospatialPoint otherPoint)
Calculates the "great circle" or orthometric distance between this point and another point on the earth's surface. The great circle distance is the minimum distance traveled to get from one point to the next on the surface of the earth.
Implementations of this method that incorporate the radius of the
earth should reference the EARTH_RADIUS
property of this
interface.
otherPoint
- the other point to which to calculate distanceEARTH_RADIUS
double getDistanceTo(double latitude, double longitude)
Calculates the "great circle" or orthometric distance between this point and another point on the earth's surface. The great circle distance is the minimum distance traveled to get from one point to the next on the surface of the earth.
Implementations of this method that incorporate the radius of the
earth should reference the EARTH_RADIUS
property of this
interface.
latitude
- the latitude, in degrees, of the other point to which to
calculate distancelongitude
- the longitude, in degrees, of the other point to which to
calculate distanceEARTH_RADIUS
jeospatial is an open-source library hosted at https://github.com/jchambers/jeospatial.