Class Datum

java.lang.Object
noaa.coastwatch.util.trans.Datum
All Implemented Interfaces:
SpheroidConstants

public class Datum extends Object implements 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
  • 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

      public Datum(String datumName, int spheroid, double dx, double dy, double dz)
      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

      public String getDatumName()
      Gets the datum name.
    • transform

      public static EarthLocation transform(EarthLocation from, Datum toDatum, EarthLocation to)
      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. The to and from locations 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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • clone

      public Object clone()
      Overrides:
      clone in class Object