Class AbstractEarthModel

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) double a
      Model parameters: major and minor radius.
      (package private) double b
      Model parameters: major and minor radius.
      (package private) double e
      Derived model parameters: e and e squared.
      (package private) double esq
      Derived model parameters: e and e squared.
      (package private) double f
      Model parameters: flattening, inverse flattening.
      (package private) double invf
      Model parameters: flattening, inverse flattening.
      private static int MAX_ITER
      Maximum number of iterations.
      private static double PRECISION
      Maximum desired precision.
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractEarthModel​(double a, double b, double f, double invf)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double distanceDeg​(double lat1, double lng1, double lat2, double lng2)
      Compute the geodetic distance between two surface coordinates.
      double distanceRad​(double lat1, double lng1, double lat2, double lng2)
      Compute the geodetic distance between two surface coordinates.
      double ecefToLatDeg​(double x, double y, double z)
      Convert a 3D coordinate pair to the corresponding latitude.
      double[] ecefToLatLngDegHeight​(double x, double y, double z)
      Convert a 3D coordinate pair to the corresponding latitude, longitude and height.
      double[] ecefToLatLngRadHeight​(double x, double y, double z)
      Convert a 3D coordinate pair to the corresponding latitude, longitude and height.
      double ecefToLatRad​(double x, double y, double z)
      Convert a 3D coordinate pair to the corresponding latitude.
      double ecefToLngDeg​(double x, double y)
      Convert a 3D coordinate pair to the corresponding longitude.
      double ecefToLngRad​(double x, double y)
      Convert a 3D coordinate pair to the corresponding longitude.
      double getEquatorialRadius()
      Equatorial radius
      double getPolarDistance()
      Polar distance.
      double[] latLngDegToECEF​(double lat, double lng)
      Map a degree latitude, longitude pair to 3D X-Y-Z coordinates, using a spherical earth model.
      double[] latLngDegToECEF​(double lat, double lng, double h)
      Map a degree latitude, longitude pair to 3D X-Y-Z coordinates, using a spherical earth model.
      double[] latLngRadToECEF​(double lat, double lng)
      Map a radians latitude, longitude pair to 3D X-Y-Z coordinates, using a spherical earth model.
      double[] latLngRadToECEF​(double lat, double lng, double h)
      Map a radians latitude, longitude pair to 3D X-Y-Z coordinates, using a spherical earth model.
      double minDistDeg​(double plat, double plng, double rminlat, double rminlng, double rmaxlat, double rmaxlng)
      Compute a lower bound for the geodetic distance point to rectangle.
      double minDistRad​(double plat, double plng, double rminlat, double rminlng, double rmaxlat, double rmaxlng)
      Compute a lower bound for the geodetic distance point to rectangle.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • MAX_ITER

        private static final int MAX_ITER
        Maximum number of iterations.
        See Also:
        Constant Field Values
      • PRECISION

        private static final double PRECISION
        Maximum desired precision.
        See Also:
        Constant Field Values
      • a

        final double a
        Model parameters: major and minor radius.
      • b

        final double b
        Model parameters: major and minor radius.
      • f

        final double f
        Model parameters: flattening, inverse flattening.
      • invf

        final double invf
        Model parameters: flattening, inverse flattening.
      • e

        final double e
        Derived model parameters: e and e squared.
      • esq

        final double esq
        Derived model parameters: e and e squared.
    • Constructor Detail

      • AbstractEarthModel

        public AbstractEarthModel​(double a,
                                  double b,
                                  double f,
                                  double invf)
        Constructor.
        Parameters:
        a - Major axis radius
        b - Minor axis radius
        f - Flattening
        invf - Inverse flattening
    • Method Detail

      • getEquatorialRadius

        public double getEquatorialRadius()
        Description copied from interface: EarthModel
        Equatorial radius
        Specified by:
        getEquatorialRadius in interface EarthModel
        Returns:
        Radius
      • getPolarDistance

        public double getPolarDistance()
        Description copied from interface: EarthModel
        Polar distance.
        Specified by:
        getPolarDistance in interface EarthModel
        Returns:
        Distance to poles (= minor radius)
      • latLngDegToECEF

        public double[] latLngDegToECEF​(double lat,
                                        double lng)
        Description copied from interface: EarthModel
        Map a degree latitude, longitude pair to 3D X-Y-Z coordinates, using a spherical earth model.

        The coordinate system is usually chosen such that the earth rotates around the Z axis and X points to the prime meridian and Equator.

        Specified by:
        latLngDegToECEF in interface EarthModel
        Parameters:
        lat - Latitude in degree
        lng - Longitude in degree
        Returns:
        Coordinate triple, in meters.
      • latLngDegToECEF

        public double[] latLngDegToECEF​(double lat,
                                        double lng,
                                        double h)
        Description copied from interface: EarthModel
        Map a degree latitude, longitude pair to 3D X-Y-Z coordinates, using a spherical earth model.

        The coordinate system is usually chosen such that the earth rotates around the Z axis and X points to the prime meridian and Equator.

        Specified by:
        latLngDegToECEF in interface EarthModel
        Parameters:
        lat - Latitude in degree
        lng - Longitude in degree
        h - Height
        Returns:
        Coordinate triple, in meters.
      • latLngRadToECEF

        public double[] latLngRadToECEF​(double lat,
                                        double lng)
        Description copied from interface: EarthModel
        Map a radians latitude, longitude pair to 3D X-Y-Z coordinates, using a spherical earth model.

        The coordinate system is usually chosen such that the earth rotates around the Z axis and X points to the prime meridian and Equator.

        Specified by:
        latLngRadToECEF in interface EarthModel
        Parameters:
        lat - Latitude in radians
        lng - Longitude in radians
        Returns:
        Coordinate triple, in meters.
      • latLngRadToECEF

        public double[] latLngRadToECEF​(double lat,
                                        double lng,
                                        double h)
        Description copied from interface: EarthModel
        Map a radians latitude, longitude pair to 3D X-Y-Z coordinates, using a spherical earth model.

        The coordinate system is usually chosen such that the earth rotates around the Z axis and X points to the prime meridian and Equator.

        Specified by:
        latLngRadToECEF in interface EarthModel
        Parameters:
        lat - Latitude in radians
        lng - Longitude in radians
        h - Height
        Returns:
        Coordinate triple, in meters.
      • ecefToLatDeg

        public double ecefToLatDeg​(double x,
                                   double y,
                                   double z)
        Description copied from interface: EarthModel
        Convert a 3D coordinate pair to the corresponding latitude.
        Specified by:
        ecefToLatDeg in interface EarthModel
        Parameters:
        x - X value
        y - Y value
        z - Z value
        Returns:
        Latitude in degrees
      • ecefToLatRad

        public double ecefToLatRad​(double x,
                                   double y,
                                   double z)
        Description copied from interface: EarthModel
        Convert a 3D coordinate pair to the corresponding latitude.
        Specified by:
        ecefToLatRad in interface EarthModel
        Parameters:
        x - X value
        y - Y value
        z - Z value
        Returns:
        Latitude in radians
      • ecefToLngDeg

        public double ecefToLngDeg​(double x,
                                   double y)
        Description copied from interface: EarthModel
        Convert a 3D coordinate pair to the corresponding longitude.
        Specified by:
        ecefToLngDeg in interface EarthModel
        Parameters:
        x - X value
        y - Y value
        Returns:
        Longitude in degrees
      • ecefToLngRad

        public double ecefToLngRad​(double x,
                                   double y)
        Description copied from interface: EarthModel
        Convert a 3D coordinate pair to the corresponding longitude.
        Specified by:
        ecefToLngRad in interface EarthModel
        Parameters:
        x - X value
        y - Y value
        Returns:
        Longitude in radians
      • distanceDeg

        public double distanceDeg​(double lat1,
                                  double lng1,
                                  double lat2,
                                  double lng2)
        Description copied from interface: EarthModel
        Compute the geodetic distance between two surface coordinates.
        Specified by:
        distanceDeg in interface EarthModel
        Parameters:
        lat1 - Latitude of first in degrees.
        lng1 - Longitude of first in degrees.
        lat2 - Latitude of second in degrees.
        lng2 - Longitude of second in degrees.
        Returns:
        Distance in meters.
      • distanceRad

        public double distanceRad​(double lat1,
                                  double lng1,
                                  double lat2,
                                  double lng2)
        Description copied from interface: EarthModel
        Compute the geodetic distance between two surface coordinates.
        Specified by:
        distanceRad in interface EarthModel
        Parameters:
        lat1 - Latitude of first in radians.
        lng1 - Longitude of first in radians.
        lat2 - Latitude of second in radians.
        lng2 - Longitude of second in radians.
        Returns:
        Distance in meters.
      • minDistDeg

        public double minDistDeg​(double plat,
                                 double plng,
                                 double rminlat,
                                 double rminlng,
                                 double rmaxlat,
                                 double rmaxlng)
        Description copied from interface: EarthModel
        Compute a lower bound for the geodetic distance point to rectangle.
        Specified by:
        minDistDeg in interface EarthModel
        Parameters:
        plat - Latitude of point in degrees.
        plng - Longitude of point in degrees.
        rminlat - Min latitude of rectangle in degrees.
        rminlng - Min Longitude of rectangle in degrees.
        rmaxlat - Max Latitude of rectangle in degrees.
        rmaxlng - Max Longitude of rectangle in degrees.
        Returns:
        Distance in meters.
      • minDistRad

        public double minDistRad​(double plat,
                                 double plng,
                                 double rminlat,
                                 double rminlng,
                                 double rmaxlat,
                                 double rmaxlng)
        Description copied from interface: EarthModel
        Compute a lower bound for the geodetic distance point to rectangle.
        Specified by:
        minDistRad in interface EarthModel
        Parameters:
        plat - Latitude of point in radians.
        plng - Longitude of point in radians.
        rminlat - Min latitude of rectangle in radians.
        rminlng - Min Longitude of rectangle in radians.
        rmaxlat - Max Latitude of rectangle in radians.
        rmaxlng - Max Longitude of rectangle in radians.
        Returns:
        Distance in meters.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object