Courtesy of Openmap
Written by Don Dietrick, BBNT
Encapsulates latitude and longitude coordinates in decimal degrees.
Normalizes the internal representation of latitude and longitude.
Normalized Latitude:
-90° <= φ <= 90°
Normalized Longitude:
-180° <= λ <= 180°
Also supports conversion to/from Cougaar core Latitude and Longitude See Also:Location
Used by the projection code for read-only quick access.
This is meant for quick backdoor access by the projection library.
Modify at your own risk!
See Also:LatLonPoint.lat_
Used by the projection code for read-only quick access.
This is meant for quick backdoor access by the projection library.
Modify at your own risk!
See Also:LatLonPoint.lon_
Construct a LatLonPoint from raw float lat/lon in decimal degrees.
Parameters: lat - latitude in decimal degrees Parameters: lon - longitude in decimal degrees
Creates a new LatLonPoint from the core measures
Parameters: lat - a Latitude Parameters: lon - a Longitude
LatLonPoint
public LatLonPoint(float lat, float lon, boolean isRadian)(Code)
Construct a LatLonPoint from raw float lat/lon in radians.
Parameters: lat - latitude in radians Parameters: lon - longitude in radians Parameters: isRadian - placeholder indicates radians
Determines whether two LatLonPoints are equal.
Parameters: obj - Object Whether the two points are equal up to a tolerance of10-5 degrees in latitude and longitude.
public static boolean isInvalidLatitude(float lat)(Code)
Check if latitude is bogus.
Latitude is invalid if lat > 90° or if lat < -90°.
Parameters: lat - latitude in decimal degrees boolean true if latitude is invalid
isInvalidLongitude
public static boolean isInvalidLongitude(float lon)(Code)
Check if longitude is bogus.
Longitude is invalid if lon > 180° or if lon < -180°.
Parameters: lon - longitude in decimal degrees boolean true if longitude is invalid
normalize_latitude
final public static float normalize_latitude(float lat)(Code)
Sets latitude to something sane.
Parameters: lat - latitude in decimal degrees float normalized latitude in decimal degrees(-90° <= φ <= 90°)
Set latitude and longitude.
Parameters: lat - latitude in decimal degrees Parameters: lon - longitude in decimal degrees
setLatLon
public void setLatLon(float lat, float lon, boolean isRadian)(Code)
Set latitude and longitude.
Parameters: lat - latitude in radians Parameters: lon - longitude in radians Parameters: isRadian - placeholder indicates radians