|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bbn.openmap.LatLonPoint
Encapsulates latitude and longitude coordinates in decimal degrees. Normalizes the internal representation of latitude and longitude.
Normalized Latitude:
−90° <= φ <= 90°
Normalized Longitude:
−180° ≤ λ ≤ 180°
Field Summary | |
static float |
DATELINE
|
static float |
EQUIVALENT_TOLERANCE
|
protected float |
lat_
|
protected float |
lon_
|
static float |
LON_RANGE
|
static float |
NORTH_POLE
|
float |
radlat_
Used by the projection code for read-only quick access. |
float |
radlon_
Used by the projection code for read-only quick access. |
static float |
SOUTH_POLE
|
Constructor Summary | |
LatLonPoint()
Construct a default LatLonPoint. |
|
LatLonPoint(double lat,
double lon)
Construct a LatLonPoint from raw double lat/lon. |
|
LatLonPoint(float lat,
float lon)
Construct a LatLonPoint from raw float lat/lon in decimal degrees. |
|
LatLonPoint(float lat,
float lon,
boolean isRadian)
Construct a LatLonPoint from raw float lat/lon in radians. |
|
LatLonPoint(LatLonPoint pt)
Copy construct a LatLonPoint. |
Method Summary | |
float |
azimuth(LatLonPoint toPoint)
Find the azimuth to another point, based on the sphercal earth model. |
java.lang.Object |
clone()
Clone the LatLonPoint. |
float |
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. |
float |
getLatitude()
Get normalized latitude. |
float |
getLongitude()
Get wrapped longitude. |
LatLonPoint |
getPoint(float dist,
float az)
Find a LatLonPoint a distance and direction away from this point, based on the sphercal earth model. |
int |
hashCode()
Hash the lat/lon value. |
static boolean |
isInvalidLatitude(float lat)
Check if latitude is bogus. |
static boolean |
isInvalidLongitude(float lon)
Check if longitude is bogus. |
static float |
normalize_latitude(float lat)
Sets latitude to something sane. |
void |
read(java.io.DataInputStream s)
Read object. |
void |
read(java.io.DataInputStream s,
boolean inRadians)
Read object. |
void |
setLatitude(float lat)
Set latitude. |
void |
setLatLon(float lat,
float lon)
Set latitude and longitude. |
void |
setLatLon(float lat,
float lon,
boolean isRadian)
Set latitude and longitude. |
void |
setLatLon(LatLonPoint llpt)
Set LatLonPoint. |
void |
setLongitude(float lon)
Set longitude. |
java.lang.String |
toString()
Returns a string representation of the object. |
static float |
wrap_longitude(float lon)
Sets longitude to something sane. |
void |
write(java.io.DataOutputStream s)
Write object. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final float NORTH_POLE
public static final float SOUTH_POLE
public static final float DATELINE
public static final float LON_RANGE
protected float lat_
protected float lon_
public static final float EQUIVALENT_TOLERANCE
public transient float radlat_
lat_
public transient float radlon_
lon_
Constructor Detail |
public LatLonPoint()
public LatLonPoint(float lat, float lon)
lat
- latitude in decimal degreeslon
- longitude in decimal degreespublic LatLonPoint(float lat, float lon, boolean isRadian)
lat
- latitude in radianslon
- longitude in radiansisRadian
- placeholder indicates radianspublic LatLonPoint(LatLonPoint pt)
pt
- LatLonPointpublic LatLonPoint(double lat, double lon)
lat
- latitude in decimal degreeslon
- longitude in decimal degreesMethod Detail |
public java.lang.String toString()
public java.lang.Object clone()
public void setLatitude(float lat)
lat
- latitude in decimal degreespublic void setLongitude(float lon)
lon
- longitude in decimal degreespublic void setLatLon(float lat, float lon)
lat
- latitude in decimal degreeslon
- longitude in decimal degreespublic void setLatLon(float lat, float lon, boolean isRadian)
lat
- latitude in radianslon
- longitude in radiansisRadian
- placeholder indicates radianspublic void setLatLon(LatLonPoint llpt)
llpt
- LatLonPointpublic float getLatitude()
public float getLongitude()
public boolean equals(java.lang.Object obj)
obj
- Object
public int hashCode()
public void write(java.io.DataOutputStream s) throws java.io.IOException
s
- DataOutputStream
java.io.IOException
public void read(java.io.DataInputStream s) throws java.io.IOException
s
- DataInputStream
java.io.IOException
public void read(java.io.DataInputStream s, boolean inRadians) throws java.io.IOException
s
- DataInputStreaminRadians
- if true, the floats read off stream will be
considered to be radians. Otherwise, they will be
considered to be decimal degrees.
java.io.IOException
public static final float normalize_latitude(float lat)
lat
- latitude in decimal degrees
public static final float wrap_longitude(float lon)
lon
- longitude in decimal degrees
public static boolean isInvalidLatitude(float lat)
lat
- latitude in decimal degrees
public static boolean isInvalidLongitude(float lon)
lon
- longitude in decimal degrees
public LatLonPoint getPoint(float dist, float az)
dist
- distance, in radians.az
- radians of azimuth (direction) east of north (-PI
<= Az < PI)
public float distance(LatLonPoint toPoint)
toPoint
- LatLonPoint
public float azimuth(LatLonPoint toPoint)
toPoint
- LatLonPoint
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |