public class CoordinateUtility extends Object
ICoordinate
s.http://en.wikipedia.org/wiki/Geographic_coordinate_system
,
http://en.wikipedia.org/wiki/Earth_radius
,
http://barelybad.com/north_of_canada_map.htm
Modifier and Type | Field and Description |
---|---|
static double |
metersPerDegreeOfLatitudeAtSeaLevel
The #of meters per degree of latitude at sea level (this is the same
regardless of the degrees north/south).
|
static double |
metersPerMinuteOfLatitudeAtSeaLevel
The #of meters per minute of latitude at sea level (this is the same
regardless of the degrees north/south).
|
static double |
metersPerSecondOfLatitudeAtSeaLevel
The #of meters per second of latitude at sea level
30.82
(this is the same regardless of the degrees north/south). |
static double |
metersPerSecondOfLongitudeAtSeaLevelAtEquator
The #of meters per second of longitude at sea level on the equator.
|
Constructor and Description |
---|
CoordinateUtility() |
Modifier and Type | Method and Description |
---|---|
static double |
approxMetersPerDegreeOfLongitudeAtSeaLevel(double degreesNorth)
The approximate width of a longitudinal degree on a given latitude.
|
static void |
assertDegreeLatitude(double d) |
static void |
assertDegreeLongitude(double d) |
static CoordinateDD |
boundingBoxNorthEast(CoordinateDD start,
double distance,
ICoordinate.UNITS units) |
static CoordinateDD |
boundingBoxSouthWest(CoordinateDD start,
double distance,
ICoordinate.UNITS units) |
static double |
distance(CoordinateDD p1,
CoordinateDD p2,
ICoordinate.UNITS units)
Computes the distance between two coordinates.
|
static double |
distanceInMeters(double latP1,
double latP2,
double lonP1,
double lonP2)
Computes the distance between two coordinates in meters.
|
static double |
metersToUnits(double meters,
ICoordinate.UNITS units)
Convert meters to the desired units.
|
static double |
realMetersPerDegreeOfLongitudeAtSeaLevel(double degreesNorth)
The real width of a longitudinal degree on a given latitude (this
accounts for the flattening of the Earth).
|
static double |
toDecimalDegrees(int degrees,
int minutes,
double seconds)
Convert Degrees, Minutes, and Seconds to Decimal Degrees.
|
static double |
toDegrees(double radians)
Convert radians to degrees.
|
static double |
toRadians(double degrees)
Convert degrees to radians.
|
static double |
unitsToMeters(double val,
ICoordinate.UNITS units)
Convert meters to the desired units.
|
public static double metersPerSecondOfLatitudeAtSeaLevel
30.82
(this is the same regardless of the degrees north/south).public static double metersPerMinuteOfLatitudeAtSeaLevel
public static double metersPerDegreeOfLatitudeAtSeaLevel
public static double metersPerSecondOfLongitudeAtSeaLevelAtEquator
public static double realMetersPerDegreeOfLongitudeAtSeaLevel(double degreesNorth)
degreesNorth
- The latitude (north/south).approxMetersPerDegreeOfLongitudeAtSeaLevel(double)
public static CoordinateDD boundingBoxSouthWest(CoordinateDD start, double distance, ICoordinate.UNITS units)
public static CoordinateDD boundingBoxNorthEast(CoordinateDD start, double distance, ICoordinate.UNITS units)
public static void assertDegreeLatitude(double d)
public static void assertDegreeLongitude(double d)
public static double approxMetersPerDegreeOfLongitudeAtSeaLevel(double degreesNorth)
Note: This routine is faster than
realMetersPerDegreeOfLongitudeAtSeaLevel(double)
but does not
account for the flattening of the Earth.
degreesNorth
- The latitude (north/south).realMetersPerDegreeOfLongitudeAtSeaLevel(double)
public static double toRadians(double degrees)
degrees
- The angle in degrees.public static double toDegrees(double radians)
radians
- The angle in radians.public static double distance(CoordinateDD p1, CoordinateDD p2, ICoordinate.UNITS units)
p1
- coordinate onep2
- coordinate twounits
- desired return unitpublic static double distanceInMeters(double latP1, double latP2, double lonP1, double lonP2)
latP1
- latitude of point #1latP2
- latitude of point #2lonP1
- latitude of point #1lonP1
- latitude of point #2units
- desired return unitpublic static double metersToUnits(double meters, ICoordinate.UNITS units)
meters
- The #of meters.units
- The target units.public static double unitsToMeters(double val, ICoordinate.UNITS units)
meters
- The #of meters.units
- The target units.public static double toDecimalDegrees(int degrees, int minutes, double seconds)
degrees
- Degreesminutes
- Minutes (w/ fraction).seconds
- Seconds (w/ fractial seconds).Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.