|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bbn.openmap.proj.coords.DMSLatLonPoint
public class DMSLatLonPoint
Encapsulates a latitude and longitude coordinate in degrees, minutes and seconds as well as the sign.
Original code contributed by Colin Mummery (colin_mummery@yahoo.com)
| Field Summary | |
|---|---|
int |
lat_degrees
The number of degrees in the latitude. |
boolean |
lat_isnegative
Indicates if the latitude is negative, the actual int values are always positive. |
int |
lat_minutes
The number of minutes in the latitude. |
double |
lat_seconds
The number of seconds in the latitude. |
int |
lon_degrees
The number of degrees in the longitude. |
boolean |
lon_isnegative
Indicates if the longitude is negative, the actual int values are always positive. |
int |
lon_minutes
The number of minutes in the longitude. |
double |
lon_seconds
The number of seconds in the longitude. |
| Constructor Summary | |
|---|---|
DMSLatLonPoint()
Construct a default LatLonPoint with zero values. |
|
DMSLatLonPoint(boolean lat_isnegative,
int lat_degrees,
int lat_minutes,
double lat_seconds,
boolean lon_isnegative,
int lon_degrees,
int lon_minutes,
double lon_seconds)
Construct a DMSLatLonPoint from raw int lat/lon. |
|
DMSLatLonPoint(int lat_degrees,
double lat_minutesDotSeconds,
int lon_degrees,
double lon_minutesDotSeconds)
Create DMSLatLonPoint from different notation |
|
DMSLatLonPoint(int lat_degrees,
int lat_minutes,
double lat_seconds,
int lon_degrees,
int lon_minutes,
double lon_seconds)
Create DMSLatLonPoint where lat_degrees and lon_degrees are signed, negative for South and West. |
|
DMSLatLonPoint(LatLonPoint llp)
Constructs a new DMSLatLonPoint given a LatLonPoint instance |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Clone the DMSLatLonPoint. |
boolean |
equals(java.lang.Object obj)
Determines whether two DMSLatLonPoints are exactly equal. |
double |
getDecimalLatitude()
Returns the latitude as decimal degrees. |
double |
getDecimalLongitude()
Returns the longitude as decimal degrees. |
LatLonPoint |
getLatLonPoint()
Return a LatLonPoint from this DMSLatLonPoint. |
LatLonPoint |
getLatLonPoint(LatLonPoint llp)
Return a LatLonPoint from this DMSLatLonPoint. |
int |
hashCode()
Generate a hash value for the point. |
static double |
normalize_value(double val)
Sets the minutes and seconds to something sane. |
static int |
normalize_value(int val)
Sets the minutes and seconds to something sane. |
void |
setDMSLatLon(DMSLatLonPoint llpt)
Set DMSLatLonPoint. |
java.lang.String |
toString()
Returns a string representation of the object. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public boolean lat_isnegative
public int lat_degrees
public int lat_minutes
public double lat_seconds
public boolean lon_isnegative
public int lon_degrees
public int lon_minutes
public double lon_seconds
| Constructor Detail |
|---|
public DMSLatLonPoint()
public DMSLatLonPoint(int lat_degrees,
int lat_minutes,
double lat_seconds,
int lon_degrees,
int lon_minutes,
double lon_seconds)
lat_degrees - lat_minutes - lat_seconds - lon_degrees - lon_minutes - lon_seconds -
public DMSLatLonPoint(boolean lat_isnegative,
int lat_degrees,
int lat_minutes,
double lat_seconds,
boolean lon_isnegative,
int lon_degrees,
int lon_minutes,
double lon_seconds)
lat_isnegative - boolean value indicating the sign of the latitudelat_degrees - integer number of degrees in latitudelat_minutes - integer number of minutes in latitudelat_seconds - float number of seconds in latitudelon_isnegative - boolean value indicating the sign of the longitudelon_degrees - integer number of degrees in longitudelon_minutes - integer number of minutes in longitudelon_seconds - float number of seconds in longitude
public DMSLatLonPoint(int lat_degrees,
double lat_minutesDotSeconds,
int lon_degrees,
double lon_minutesDotSeconds)
lat_degrees - integer degrees for lat, signed negative for Southlat_minutesDotSeconds - positive decimal minutes.seconds fractionlon_degrees - integer degrees for lon, signed negative for Westlon_minutesDotSeconds - positive decimal minutes.seconds fractionpublic DMSLatLonPoint(LatLonPoint llp)
llp - A LatLonPoint instance| Method Detail |
|---|
public LatLonPoint getLatLonPoint()
public LatLonPoint getLatLonPoint(LatLonPoint llp)
llp - the LatLonPoint to load up.
public double getDecimalLatitude()
public double getDecimalLongitude()
public java.lang.String toString()
toString in class java.lang.Objectpublic void setDMSLatLon(DMSLatLonPoint llpt)
llpt - DMSLatLonPointpublic java.lang.Object clone()
clone in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - Object
public static final int normalize_value(int val)
val - an int value for the minutes or seconds
public static final double normalize_value(double val)
val - an double value for the minutes or seconds
public int hashCode()
hashCode in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||