org.apache.lucene.spatial.util

## Class GeoProjectionUtils

- java.lang.Object
- - org.apache.lucene.spatial.util.GeoProjectionUtils

-     public class GeoProjectionUtils
      extends Object

  Reusable geo-spatial projection utility methods.
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static double` | `ECCENTRICITY` first eccentricity (e)
    `static double` | `FLATTENING` earth flattening factor (f)
    `static double` | `MAX_LAT_RADIANS` max latitude value in radians
    `static double` | `MAX_LON_RADIANS` max longitude value in radians
    `static double` | `MIN_LAT_RADIANS` min latitude value in radians
    `static double` | `MIN_LON_RADIANS` min longitude value in radians
    `static double` | `SEMIMAJOR_AXIS` major (a) axis in meters
    `static double` | `SEMIMAJOR_AXIS2` major axis squared (a2)
    `static double` | `SEMIMINOR_AXIS` minor (b) axis in meters
    `static double` | `SEMIMINOR_AXIS2` minor axis squared (b2)

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static double` | `bearingGreatCircle(double lon1, double lat1, double lon2, double lat2)` Finds the bearing (in degrees) between 2 geo points (lon, lat) using great circle arc
    `static double[]` | `ecfToENU(double x, double y, double z, double centerLon, double centerLat, double centerAlt, double[] enu)` Convert from Earth-Centered-Fixed to Easting, Northing, Up Right Hand System
    `static double[]` | `ecfToLLA(double x, double y, double z, double[] lla)` Converts from geocentric earth-centered earth-fixed to geodesic lat/lon/alt
    `static double[]` | `enuToECF(double x, double y, double z, double centerLon, double centerLat, double centerAlt, double[] ecf)` Convert from Easting, Northing, Up Right-Handed system to Earth Centered Fixed system
    `static double[]` | `enuToLLA(double x, double y, double z, double centerLon, double centerLat, double centerAlt, double[] lla)` Converts from East North Up right-hand rule to lat lon alt in degrees
    `static double[]` | `llaToECF(double lon, double lat, double alt, double[] ecf)` Converts from geodesic lon lat alt to geocentric earth-centered earth-fixed
    `static double[]` | `llaToENU(double lon, double lat, double alt, double centerLon, double centerLat, double centerAlt, double[] enu)` Converts from lat lon alt (in degrees) to East North Up right-hand coordinate system
    `static double[]` | `pointFromLonLatBearingGreatCircle(double lon, double lat, double bearing, double dist, double[] pt)` Finds a point along a bearing from a given lon,lat geolocation using great circle arc
    `static double[]` | `pointFromLonLatBearingVincenty(double lon, double lat, double bearing, double dist, double[] pt)` Finds a point along a bearing from a given lon,lat geolocation using vincenty's distance formula

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### SEMIMAJOR_AXIS

          public static final double SEMIMAJOR_AXIS

      major (a) axis in meters
      See Also:
        Constant Field Values

    - #### FLATTENING

          public static final double FLATTENING

      earth flattening factor (f)
      See Also:
        Constant Field Values

    - #### SEMIMINOR_AXIS

          public static final double SEMIMINOR_AXIS

      minor (b) axis in meters
      See Also:
        Constant Field Values

    - #### ECCENTRICITY

          public static final double ECCENTRICITY

      first eccentricity (e)

    - #### SEMIMAJOR_AXIS2

          public static final double SEMIMAJOR_AXIS2

      major axis squared (a2)
      See Also:
        Constant Field Values

    - #### SEMIMINOR_AXIS2

          public static final double SEMIMINOR_AXIS2

      minor axis squared (b2)
      See Also:
        Constant Field Values

    - #### MIN_LON_RADIANS

          public static final double MIN_LON_RADIANS

      min longitude value in radians
      See Also:
        Constant Field Values

    - #### MIN_LAT_RADIANS

          public static final double MIN_LAT_RADIANS

      min latitude value in radians
      See Also:
        Constant Field Values

    - #### MAX_LON_RADIANS

          public static final double MAX_LON_RADIANS

      max longitude value in radians
      See Also:
        Constant Field Values

    - #### MAX_LAT_RADIANS

          public static final double MAX_LAT_RADIANS

      max latitude value in radians
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### ecfToLLA

          public static final double[] ecfToLLA(double x,
                          double y,
                          double z,
                          double[] lla)

      Converts from geocentric earth-centered earth-fixed to geodesic lat/lon/alt
      Parameters:
        `x` - Cartesian x coordinate
        `y` - Cartesian y coordinate
        `z` - Cartesian z coordinate
        `lla` - 0: longitude 1: latitude: 2: altitude
      Returns:
        double array as 0: longitude 1: latitude 2: altitude

    - #### llaToECF

          public static final double[] llaToECF(double lon,
                          double lat,
                          double alt,
                          double[] ecf)

      Converts from geodesic lon lat alt to geocentric earth-centered earth-fixed
      Parameters:
        `lon` - geodesic longitude
        `lat` - geodesic latitude
        `alt` - geodesic altitude
        `ecf` - reusable earth-centered earth-fixed result
      Returns:
        either a new ecef array or the reusable ecf parameter

    - #### llaToENU

          public static double[] llaToENU(double lon,
                          double lat,
                          double alt,
                          double centerLon,
                          double centerLat,
                          double centerAlt,
                          double[] enu)

      Converts from lat lon alt (in degrees) to East North Up right-hand coordinate system
      Parameters:
        `lon` - longitude in degrees
        `lat` - latitude in degrees
        `alt` - altitude in meters
        `centerLon` - reference point longitude in degrees
        `centerLat` - reference point latitude in degrees
        `centerAlt` - reference point altitude in meters
        `enu` - result east, north, up coordinate
      Returns:
        east, north, up coordinate

    - #### enuToLLA

          public static double[] enuToLLA(double x,
                          double y,
                          double z,
                          double centerLon,
                          double centerLat,
                          double centerAlt,
                          double[] lla)

      Converts from East North Up right-hand rule to lat lon alt in degrees
      Parameters:
        `x` - easting (in meters)
        `y` - northing (in meters)
        `z` - up (in meters)
        `centerLon` - reference point longitude (in degrees)
        `centerLat` - reference point latitude (in degrees)
        `centerAlt` - reference point altitude (in meters)
        `lla` - resulting lat, lon, alt point (in degrees)
      Returns:
        lat, lon, alt point (in degrees)

    - #### ecfToENU

          public static double[] ecfToENU(double x,
                          double y,
                          double z,
                          double centerLon,
                          double centerLat,
                          double centerAlt,
                          double[] enu)

      Convert from Earth-Centered-Fixed to Easting, Northing, Up Right Hand System
      Parameters:
        `x` - ECF X coordinate (in meters)
        `y` - ECF Y coordinate (in meters)
        `z` - ECF Z coordinate (in meters)
        `centerLon` - ENU origin longitude (in degrees)
        `centerLat` - ENU origin latitude (in degrees)
        `centerAlt` - ENU altitude (in meters)
        `enu` - reusable enu result
      Returns:
        Easting, Northing, Up coordinate

    - #### enuToECF

          public static double[] enuToECF(double x,
                          double y,
                          double z,
                          double centerLon,
                          double centerLat,
                          double centerAlt,
                          double[] ecf)

      Convert from Easting, Northing, Up Right-Handed system to Earth Centered Fixed system
      Parameters:
        `x` - ENU x coordinate (in meters)
        `y` - ENU y coordinate (in meters)
        `z` - ENU z coordinate (in meters)
        `centerLon` - ENU origin longitude (in degrees)
        `centerLat` - ENU origin latitude (in degrees)
        `centerAlt` - ENU origin altitude (in meters)
        `ecf` - reusable ecf result
      Returns:
        ecf result coordinate

    - #### pointFromLonLatBearingVincenty

          public static final double[] pointFromLonLatBearingVincenty(double lon,
                                                double lat,
                                                double bearing,
                                                double dist,
                                                double[] pt)

      Finds a point along a bearing from a given lon,lat geolocation using vincenty's distance formula
      Parameters:
        `lon` - origin longitude in degrees
        `lat` - origin latitude in degrees
        `bearing` - azimuthal bearing in degrees
        `dist` - distance in meters
        `pt` - resulting point
      Returns:
        the point along a bearing at a given distance in meters

    - #### pointFromLonLatBearingGreatCircle

          public static final double[] pointFromLonLatBearingGreatCircle(double lon,
                                                   double lat,
                                                   double bearing,
                                                   double dist,
                                                   double[] pt)

      Finds a point along a bearing from a given lon,lat geolocation using great circle arc
      Parameters:
        `lon` - origin longitude in degrees
        `lat` - origin latitude in degrees
        `bearing` - azimuthal bearing in degrees
        `dist` - distance in meters
        `pt` - resulting point
      Returns:
        the point along a bearing at a given distance in meters

    - #### bearingGreatCircle

          public static double bearingGreatCircle(double lon1,
                                  double lat1,
                                  double lon2,
                                  double lat2)

      Finds the bearing (in degrees) between 2 geo points (lon, lat) using great circle arc
      Parameters:
        `lon1` - first point longitude in degrees
        `lat1` - first point latitude in degrees
        `lon2` - second point longitude in degrees
        `lat2` - second point latitude in degrees
      Returns:
        the bearing (in degrees) between the two provided points

Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.