public interface ILatLon
It provides methods to get the coordinates. The coordinates may be unknown.
In this case, both lat()
and lon()
need to return a NaN value and isLatLonKnown()
needs to return false.
Whether the coordinates are immutable or not is implementation specific.
Modifier and Type | Field and Description |
---|---|
static double |
MAX_SERVER_PRECISION
Minimum difference in location to not be represented as the same position.
|
Modifier and Type | Method and Description |
---|---|
default double |
bearing(ILatLon other)
Returns bearing from this point to another.
|
default double |
distanceSq(double lon,
double lat)
Returns the square of euclidean distance from this
Coordinate to a specified coordinate. |
default double |
distanceSq(ILatLon other)
Returns the euclidean distance from this
ILatLon to a specified ILatLon . |
default boolean |
equalsEpsilon(ILatLon other)
Determines if the other point has almost the same lat/lon values.
|
default boolean |
equalsEpsilon(ILatLon other,
double precision)
Determines if the other point has almost the same lat/lon values.
|
default EastNorth |
getEastNorth(Projecting projecting)
Replies the projected east/north coordinates.
|
default double |
greatCircleDistance(ILatLon other)
Computes the distance between this lat/lon and another point on the earth.
|
default ILatLon |
interpolate(ILatLon ll2,
double proportion)
Does a linear interpolation between two ILatLon instances.
|
default boolean |
isLatLonKnown()
Determines if this object has valid coordinates.
|
double |
lat()
Returns the latitude, i.e., the north-south position in degrees.
|
double |
lon()
Returns the longitude, i.e., the east-west position in degrees.
|
static final double MAX_SERVER_PRECISION
double lon()
isLatLonKnown()
returns falsedouble lat()
isLatLonKnown()
returns falsedefault boolean isLatLonKnown()
true
if this object has valid coordinatesdefault EastNorth getEastNorth(Projecting projecting)
The result of the last conversion may be cached. Null is returned in case this object is invalid.
projecting
- The projection to use.default boolean equalsEpsilon(ILatLon other)
other
- other lat/lontrue
if the other point has almost the same lat/lon
values, only differing by no more than 1 / MAX_SERVER_PRECISION
.LatLon
)default boolean equalsEpsilon(ILatLon other, double precision)
other
- other lat/lonprecision
- The precision to usetrue
if the other point has almost the same lat/lon
values, only differing by no more than 1 / precision.LatLon
)default double greatCircleDistance(ILatLon other)
other
- the other point.LatLon
)default double bearing(ILatLon other)
other
- the "destination" positionLatLon
, added in 9796)default ILatLon interpolate(ILatLon ll2, double proportion)
ll2
- The other ILatLon instance.proportion
- The proportion the other instance influences the result.ILatLon
position.default double distanceSq(double lon, double lat)
Coordinate
to a specified coordinate.lon
- the X coordinate of the specified point to be measured against this Coordinate
lat
- the Y coordinate of the specified point to be measured against this Coordinate
Coordinate
to a specified coordinatedefault double distanceSq(ILatLon other)
ILatLon
to a specified ILatLon
.other
- the specified coordinate to be measured against this ILatLon
ILatLon
to a specified ILatLon