Interface EarthModel

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static OptionID MODEL_ID
      Parameter to choose the earth model to use.
    • Method Summary

      All Methods Instance Methods Abstract 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.
    • Field Detail

      • MODEL_ID

        static final OptionID MODEL_ID
        Parameter to choose the earth model to use.
    • Method Detail

      • latLngDegToECEF

        double[] latLngDegToECEF​(double lat,
                                 double lng)
        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.

        Parameters:
        lat - Latitude in degree
        lng - Longitude in degree
        Returns:
        Coordinate triple, in meters.
      • latLngRadToECEF

        double[] latLngRadToECEF​(double lat,
                                 double lng)
        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.

        Parameters:
        lat - Latitude in radians
        lng - Longitude in radians
        Returns:
        Coordinate triple, in meters.
      • latLngDegToECEF

        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.

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

        Parameters:
        lat - Latitude in degree
        lng - Longitude in degree
        h - Height
        Returns:
        Coordinate triple, in meters.
      • latLngRadToECEF

        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.

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

        Parameters:
        lat - Latitude in radians
        lng - Longitude in radians
        h - Height
        Returns:
        Coordinate triple, in meters.
      • ecefToLatDeg

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

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

        double ecefToLngDeg​(double x,
                            double y)
        Convert a 3D coordinate pair to the corresponding longitude.
        Parameters:
        x - X value
        y - Y value
        Returns:
        Longitude in degrees
      • ecefToLngRad

        double ecefToLngRad​(double x,
                            double y)
        Convert a 3D coordinate pair to the corresponding longitude.
        Parameters:
        x - X value
        y - Y value
        Returns:
        Longitude in radians
      • ecefToLatLngDegHeight

        double[] ecefToLatLngDegHeight​(double x,
                                       double y,
                                       double z)
        Convert a 3D coordinate pair to the corresponding latitude, longitude and height.

        Note: if you are not interested in the height, use ecefToLatDeg(double, double, double) and ecefToLngDeg(double, double) instead, which has a smaller memory footprint.

        Parameters:
        x - X value
        y - Y value
        z - Z value
        Returns:
        Array containing (latitude, longitude, height).
      • ecefToLatLngRadHeight

        double[] ecefToLatLngRadHeight​(double x,
                                       double y,
                                       double z)
        Convert a 3D coordinate pair to the corresponding latitude, longitude and height.

        Note: if you are not interested in the height, use ecefToLatRad(double, double, double) and ecefToLngRad(double, double) instead, which has a smaller memory footprint.

        Parameters:
        x - X value
        y - Y value
        z - Z value
        Returns:
        Array containing (latitude, longitude, height).
      • distanceDeg

        double distanceDeg​(double lat1,
                           double lng1,
                           double lat2,
                           double lng2)
        Compute the geodetic distance between two surface coordinates.
        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

        double distanceRad​(double lat1,
                           double lng1,
                           double lat2,
                           double lng2)
        Compute the geodetic distance between two surface coordinates.
        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

        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.
        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

        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.
        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.
      • getEquatorialRadius

        double getEquatorialRadius()
        Equatorial radius
        Returns:
        Radius
      • getPolarDistance

        double getPolarDistance()
        Polar distance.
        Returns:
        Distance to poles (= minor radius)