Package ucar.unidata.geoloc
Class LatLonPoint
- java.lang.Object
-
- ucar.unidata.geoloc.LatLonPoint
-
public abstract class LatLonPoint extends Object
Points on the Earth's surface, represented as (longitude,latitude), in units of degrees. Longitude is always between -180 and +180 deg. Latitude is always between -90 and +90 deg.
-
-
Field Summary
Fields Modifier and Type Field Description static LatLonPoint
INVALID
-
Constructor Summary
Constructors Constructor Description LatLonPoint()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static LatLonPoint
create(double lat, double lon)
Create a LatLonPoint.abstract double
getLatitude()
Returns the latitude, between +/- 90 degrees.abstract double
getLongitude()
Returns the longitude, between +/-180 degreesboolean
nearlyEquals(LatLonPoint that)
Returns the result ofnearlyEquals(LatLonPoint, double)
, withMisc.defaultMaxRelativeDiffDouble
.boolean
nearlyEquals(LatLonPoint that, double maxRelDiff)
Returnstrue
if this point is nearly equal tothat
.String
toString()
-
-
-
Field Detail
-
INVALID
public static LatLonPoint INVALID
-
-
Method Detail
-
create
public static LatLonPoint create(double lat, double lon)
Create a LatLonPoint.
-
getLatitude
public abstract double getLatitude()
Returns the latitude, between +/- 90 degrees.
-
getLongitude
public abstract double getLongitude()
Returns the longitude, between +/-180 degrees
-
nearlyEquals
public boolean nearlyEquals(LatLonPoint that)
Returns the result ofnearlyEquals(LatLonPoint, double)
, withMisc.defaultMaxRelativeDiffDouble
.
-
nearlyEquals
public boolean nearlyEquals(LatLonPoint that, double maxRelDiff)
Returnstrue
if this point is nearly equal tothat
. The "near equality" of points is determined usingMisc.nearlyEquals(double, double, double)
, with the specified maxRelDiff.- Parameters:
that
- the other point to check.maxRelDiff
- the maximumrelative difference
the two points may have.- Returns:
true
if this point is nearly equal tothat
.
-
-