Package noaa.coastwatch.util.trans
Class Datum
java.lang.Object
noaa.coastwatch.util.trans.Datum
- All Implemented Interfaces:
SpheroidConstants
A
Datum holds a geodetic datum name, spheroid name,
spheroid parameters, and WGS84-relative datum transformation
parameters. The datum may be used to transform
EarthLocation objects to and from different datums.- Since:
- 3.2.0
- Author:
- Peter Hollemans
-
Field Summary
Fields inherited from interface noaa.coastwatch.util.trans.SpheroidConstants
AIRY, AUS_NAT, BESSEL, CLARKE1866, CLARKE1880, EVEREST, GRS1980, HOUGH, INT1909, INT1967, KRASS, MAX_SPHEROIDS, MERCURY1960, MOD_AIRY, MOD_EVEREST, MOD_MER1968, SE_ASIA, SPHERE, SPHEROID_INV_FLAT, SPHEROID_NAMES, SPHEROID_SEMI_MAJOR, SPHEROID_SEMI_MINOR, STD_RADIUS, WGS66, WGS72, WGS84 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()voidcomputeECF(double lat, double lon, double[] ecf) Converts an earth location to Earth-Centered-Fixed (ECF).booleandoublegetAxis()Gets the semi-major axis in meters.Gets the datum name.doublegetE2()Gets the eccentricity value squared.doublegetFlat()Gets the flattening value.toString()static EarthLocationtransform(EarthLocation from, Datum toDatum, EarthLocation to) Transforms an earth location from one datum to another.
-
Constructor Details
-
Datum
public Datum(String datumName, String spheroidName, double axis, double invFlat, double dx, double dy, double dz) Creates a new geodetic datum based on user-specified spheroid parameters.- Parameters:
datumName- the datum name.spheroidName- the spheroid name.axis- the spheroid semi-major axis (meters).invFlat- the spheroid inverse flattening.dx- the x-axis shift (meters).dy- the y-axis shift (meters).dz- the z-axis shift (meters).
-
Datum
Creates a new geodetic datum based on a spheroid code.- Parameters:
datumName- the datum name.spheroid- the spheroid code for the datum.dx- the x-axis shift (meters).dy- the y-axis shift (meters).dz- the z-axis shift (meters).
-
-
Method Details
-
getAxis
public double getAxis()Gets the semi-major axis in meters. -
getFlat
public double getFlat()Gets the flattening value. -
getE2
public double getE2()Gets the eccentricity value squared. -
getDatumName
Gets the datum name. -
transform
Transforms an earth location from one datum to another.- Parameters:
from- the earth location to transform.toDatum- the new datum to transform to.to- the earth location to modify, or null to create a new transformed earth location. Thetoandfromlocations may be the same, in which case the location is modified in-place.- Returns:
- the new or modified earth location. The returned location will have its datum set to the new datum.
-
computeECF
public void computeECF(double lat, double lon, double[] ecf) Converts an earth location to Earth-Centered-Fixed (ECF). This is a right-handed cartesian coordinate system centered at the center of the Earth ellipsoid, with its x-axis pointing towards (0N, 0E), its y-axis pointing towards (0N, 90E), and its z-axis pointing at the north pole.- Parameters:
lat- the latitude in the range [-90..90].lon- the longitude in the range [-180..180].ecf- the output ECF coordinates in meters.- Since:
- 3.5.0
-
equals
-
toString
-
clone
-