|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opensha.commons.geo.GeoTools
public class GeoTools
This class provides static references to constants and conversions useful for geographic calculations, as well as a variety of utility methods.
| Field Summary | |
|---|---|
static double |
DEPTH_MAX
Maximum earthquake depth value (700 km) used for range checking. |
static double |
DEPTH_MIN
Minimum earthquake depth value (-5 km) used for range checking. |
static double |
EARTH_RADIUS_EQUATORIAL
The equatorial radius of the earth [6378.1370 km] (see Wikipedia) as derived from the WGS-84 ellipsoid. |
static double |
EARTH_RADIUS_MEAN
The Authalic mean radius (A |
static double |
EARTH_RADIUS_POLAR
The polar radius of the earth [6356.7523 km] (see Wikipedia) as derived from the WGS-84 ellipsoid. |
static double |
LAT_MAX
Maximum latitude value (90°) used for range checking. |
static double |
LAT_MIN
Minimum latitude value (-90°) used for range checking. |
static double |
LON_MAX
Maximum longitude value (180°) used for range checking. |
static double |
LON_MIN
Minimum longitude value (-180°) used for range checking. |
static double |
MINUTES_PER_DEGREE
Convenience constant for arcminutes per degree (60). |
static double |
PI_BY_2
Convenience constant for PI / 2 |
static double |
SECONDS_PER_DEGREE
Convenience constant for arcseconds per degree (3600). |
static double |
TO_DEG
Conversion multiplier for radians to degrees |
static double |
TO_RAD
Conversion multiplier for degrees to radians |
static double |
TWOPI
Convenience constant for 2 * PI |
| Constructor Summary | |
|---|---|
GeoTools()
|
|
| Method Summary | |
|---|---|
static double |
degreesLatPerKm(Location p)
Returns the number of degrees of latitude per km at a given Location. |
static double |
degreesLonPerKm(Location p)
Returns the number of degrees of longitude per km at a given Location. |
static double |
minutesToDeg(double minutes)
Converts arcminutes to decimal degrees. |
static double |
radiusAtLocation(Location p)
Returns the radius of the earth at the latitude of the supplied Location (see Wikipedia for source). |
static double |
secondsToDeg(double seconds)
Converts arcseconds to decimal degrees. |
static double |
toDecimalDegrees(double degrees,
double minutes)
Converts 'degree : decimal minutes' to decimal degrees. |
static void |
validateDepth(double depth)
Verifies that a depth value falls within range of DEPTH_MIN and DEPTH_MAX (inclusive). |
static void |
validateDepths(double[] depths)
Verifies that a set of depth values fall within range of DEPTH_MIN and DEPTH_MAX (inclusive). |
static void |
validateLat(double lat)
Verifies that a latitude value falls within range of LAT_MIN and LAT_MAX (inclusive). |
static void |
validateLats(double[] lats)
Verifies that an array of latitude values fall within range of LAT_MIN and LAT_MAX (inclusive). |
static void |
validateLon(double lon)
Verifies that a longitude value falls within range of LON_MIN and LON_MAX (inclusive). |
static void |
validateLons(double[] lons)
Verifies that a set of longitude values fall within range of LON_MIN and LON_MAX (inclusive). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double EARTH_RADIUS_MEAN
public static final double EARTH_RADIUS_EQUATORIAL
public static final double EARTH_RADIUS_POLAR
public static final double LAT_MIN
public static final double LAT_MAX
public static final double LON_MIN
public static final double LON_MAX
public static final double DEPTH_MIN
public static final double DEPTH_MAX
public static final double TO_RAD
public static final double TO_DEG
public static final double TWOPI
public static final double PI_BY_2
public static final double SECONDS_PER_DEGREE
public static final double MINUTES_PER_DEGREE
| Constructor Detail |
|---|
public GeoTools()
| Method Detail |
|---|
public static final void validateLats(double[] lats)
LAT_MIN and LAT_MAX (inclusive).
lats - latitudes to validate
NullPointerException - if lats is null
IllegalArgumentException - if any lats value is
out of rangeDataUtils.validate(double, double, double...)public static final void validateLat(double lat)
LAT_MIN and LAT_MAX (inclusive).
lat - latitude to validate
IllegalArgumentException - if lat value is
out of rangeDataUtils.validate(double, double, double)public static void validateLons(double[] lons)
LON_MIN and LON_MAX (inclusive).
lons - longitudes to validate
IllegalArgumentException - if any lons value is
out of rangeDataUtils.validate(double, double, double...)public static void validateLon(double lon)
LON_MIN and LON_MAX (inclusive).
lon - longitude to validate
IllegalArgumentException - if lon value is
out of rangeDataUtils.validate(double, double, double)public static void validateDepths(double[] depths)
DEPTH_MIN and DEPTH_MAX (inclusive).
depths - depths to validate
IllegalArgumentException - if any depths value is
out of rangeDataUtils.validate(double, double, double...)public static void validateDepth(double depth)
DEPTH_MIN and DEPTH_MAX (inclusive).
depth - depth to validate
IllegalArgumentException - if a depth value is
out of rangeDataUtils.validate(double, double, double)public static double radiusAtLocation(Location p)
Location (see Wikipedia for source).
p - the Location at which to compute the earth's radius
Locationpublic static double degreesLatPerKm(Location p)
Location. This can be used to convert between km-based
and degree-based grid spacing. The calculation takes into account
the shape of the earth (oblate spheroid) and scales the conversion
accordingly.
p - the Location at which to conversion value
LocationradiusAtLocation(Location)public static double degreesLonPerKm(Location p)
Location. This can be used to convert between km-based
and degree-based grid spacing. The calculation scales the degrees
longitude per km at the equator by the cosine of the supplied
latitude. (Note: The values returned are not based on the radius
of curvature of the earth at the supplied location.)
p - the Location at which to conversion value
Locationpublic static double secondsToDeg(double seconds)
seconds - value to convert
public static double minutesToDeg(double minutes)
minutes - value to convert
public static double toDecimalDegrees(double degrees,
double minutes)
degrees - part to convertminutes - part to convert (decimal minutes)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||