|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.geom.Point2D com.bbn.openmap.proj.coords.LatLonPoint
public abstract class LatLonPoint
A Point2D representation of LatLonPoints, used integrate with the Projections. These LatLonPoints wrap their internal decimal degree values so the latitude are between -90 and 90 and the longitudes are between -180 and 180. Radian values are precalculated and held within the object.
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.
Nested Class Summary | |
---|---|
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. |
Field Summary | |
---|---|
static double |
DATELINE
|
static double |
LON_RANGE
|
static double |
NORTH_POLE
|
static double |
SOUTH_POLE
|
Constructor Summary | |
---|---|
protected |
LatLonPoint()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.awt.geom.Point2D |
---|
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, getX, getY, hashCode, setLocation, setLocation |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double NORTH_POLE
public static final double SOUTH_POLE
public static final double DATELINE
public static final double LON_RANGE
Constructor Detail |
---|
protected LatLonPoint()
Method Detail |
---|
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 degrees
public static final float wrapLongitude(float lon)
lon
-
public static final double wrapLongitude(double lon)
lon
- longitude in decimal degrees
public static boolean isInvalidLatitude(double lat)
lat
- latitude in decimal degrees
public static boolean isInvalidLongitude(double lon)
lon
- longitude in decimal degrees
public boolean equals(java.lang.Object obj)
equals
in class java.awt.geom.Point2D
obj
- Object
public double distance(LatLonPoint toPoint)
toPoint
- LatLonPoint
public double azimuth(LatLonPoint toPoint)
toPoint
- LatLonPoint
public LatLonPoint getPoint(double distance, double azimuth)
distance
- radiansazimuth
- radians
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |