public abstract class LatLonPoint
extends java.awt.geom.Point2D
implements java.lang.Cloneable, java.io.Serializable
The LatLonPoint is an abstract class and can't be instantiated directly. You need to create a Float or Double version of a LatLonPoint, much like the Point2D object.
Modifier and Type | Class and Description |
---|---|
static class |
LatLonPoint.Double
Double precision version of LatLonPoint.
|
static class |
LatLonPoint.Float
The Float version of a LatLonPoint, where coordinates are held to float
precision.
|
Modifier and Type | Field and Description |
---|---|
static double |
DATELINE |
static double |
LON_RANGE |
static double |
NORTH_POLE |
static double |
SOUTH_POLE |
Modifier | Constructor and Description |
---|---|
protected |
LatLonPoint() |
Modifier and Type | Method and Description |
---|---|
double |
azimuth(LatLonPoint toPoint)
Find the azimuth to another point, based on the spherical earth model.
|
double |
distance(LatLonPoint toPoint)
Find the distance to another LatLonPoint, based on a earth spherical
model.
|
boolean |
equals(java.lang.Object obj)
Determines whether two LatLonPoints are equal.
|
static LatLonPoint |
getDouble(java.awt.geom.Point2D pt2D)
Factory method that will create a LatLonPoint.Double from a Point2D
object.
|
static LatLonPoint |
getFloat(java.awt.geom.Point2D pt2D)
Factory method that will create a LatLonPoint.Float from a Point2D
object.
|
abstract float |
getLatitude() |
abstract float |
getLongitude() |
LatLonPoint |
getPoint(double distance,
double azimuth)
Get a new LatLonPoint a distance and azimuth from another point, based on
the spherical earth model.
|
abstract double |
getRadLat() |
abstract double |
getRadLon() |
static boolean |
isInvalidLatitude(double lat)
Check if latitude is bogus.
|
static boolean |
isInvalidLongitude(double lon)
Check if longitude is bogus.
|
static double |
normalizeLatitude(double lat)
Sets latitude to something sane.
|
static float |
normalizeLatitude(float lat)
Ensure latitude is between the poles.
|
abstract void |
setLatitude(double lat)
Set decimal degree latitude.
|
abstract void |
setLatLon(double lat,
double lon)
Set the latitude, longitude for this point.
|
abstract void |
setLatLon(double lat,
double lon,
boolean isRadians)
Set the latitude, longitude for this point, with the option of noting
whether the values are in degrees or radians.
|
void |
setLatLon(LatLonPoint llp)
Set location values from another lat/lon point.
|
abstract void |
setLongitude(double lon)
Set decimal degree longitude.
|
static double |
wrapLongitude(double lon)
Sets longitude to something sane.
|
static float |
wrapLongitude(float lon)
Ensure the longitude is between the date line.
|
public static final double NORTH_POLE
public static final double SOUTH_POLE
public static final double DATELINE
public static final double LON_RANGE
public static LatLonPoint getFloat(java.awt.geom.Point2D pt2D)
pt2D
- public static LatLonPoint getDouble(java.awt.geom.Point2D pt2D)
pt2D
- public abstract void setLatLon(double lat, double lon)
lat
- decimal degree latitudelon
- decimal degree longitude.public abstract void setLatLon(double lat, double lon, boolean isRadians)
lat
- latitudelon
- longitude.isRadians
- true of values are radians.public abstract float getLongitude()
public abstract float getLatitude()
public abstract double getRadLon()
public abstract double getRadLat()
public abstract void setLatitude(double lat)
public abstract void setLongitude(double lon)
public void setLatLon(LatLonPoint llp)
llp
- public static final float normalizeLatitude(float lat)
lat
- public static final double normalizeLatitude(double lat)
lat
- latitude in decimal degreespublic static final float wrapLongitude(float lon)
lon
- public static final double wrapLongitude(double lon)
lon
- longitude in decimal degreespublic static boolean isInvalidLatitude(double lat)
lat
- latitude in decimal degreespublic static boolean isInvalidLongitude(double lon)
lon
- longitude in decimal degreespublic boolean equals(java.lang.Object obj)
equals
in class java.awt.geom.Point2D
obj
- Objectpublic double distance(LatLonPoint toPoint)
toPoint
- LatLonPointpublic double azimuth(LatLonPoint toPoint)
toPoint
- LatLonPointpublic LatLonPoint getPoint(double distance, double azimuth)
distance
- radiansazimuth
- radiansCopyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details