org.apache.lucene.geo

## Class GeoUtils

- java.lang.Object
- - org.apache.lucene.geo.GeoUtils

-     public final class GeoUtils
      extends Object

  Basic reusable geo-spatial 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` | `EARTH_MEAN_RADIUS_METERS` mean earth axis in meters
    `static double` | `MAX_LAT_INCL` Maximum latitude value.
    `static double` | `MAX_LAT_RADIANS` max latitude value in radians
    `static double` | `MAX_LON_INCL` Maximum longitude value.
    `static double` | `MAX_LON_RADIANS` max longitude value in radians
    `static double` | `MIN_LAT_INCL` Minimum latitude value.
    `static double` | `MIN_LAT_RADIANS` min latitude value in radians
    `static double` | `MIN_LON_INCL` Minimum longitude value.
    `static double` | `MIN_LON_RADIANS` min longitude value in radians

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `checkLatitude(double latitude)` validates latitude value is within standard +/-90 coordinate bounds
    `static void` | `checkLongitude(double longitude)` validates longitude value is within standard +/-180 coordinate bounds
    `static double` | `distanceQuerySortKey(double radius)` binary search to find the exact sortKey needed to match the specified radius any sort key lte this is a query match.
    `static PointValues.Relation` | `relate(double minLat, double maxLat, double minLon, double maxLon, double lat, double lon, double distanceSortKey, double axisLat)` Compute the relation between the provided box and distance query.
    `static double` | `sloppySin(double a)` Returns the trigonometric sine of an angle converted as a cos operation.

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

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

- - ### Field Detail

    - #### MIN_LON_INCL

          public static final double MIN_LON_INCL

      Minimum longitude value.
      See Also:
        Constant Field Values

    - #### MAX_LON_INCL

          public static final double MAX_LON_INCL

      Maximum longitude value.
      See Also:
        Constant Field Values

    - #### MIN_LAT_INCL

          public static final double MIN_LAT_INCL

      Minimum latitude value.
      See Also:
        Constant Field Values

    - #### MAX_LAT_INCL

          public static final double MAX_LAT_INCL

      Maximum latitude value.
      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

    - #### EARTH_MEAN_RADIUS_METERS

          public static final double EARTH_MEAN_RADIUS_METERS

      mean earth axis in meters
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### checkLatitude

          public static void checkLatitude(double latitude)

      validates latitude value is within standard +/-90 coordinate bounds

    - #### checkLongitude

          public static void checkLongitude(double longitude)

      validates longitude value is within standard +/-180 coordinate bounds

    - #### sloppySin

          public static double sloppySin(double a)

      Returns the trigonometric sine of an angle converted as a cos operation.

      Note that this is not quite right... e.g. sin(0) != 0

      Special cases:

      - If the argument is `NaN` or an infinity, then the result is `NaN`.
      Parameters:
        `a` - an angle, in radians.
      Returns:
        the sine of the argument.
      See Also:
        `Math.sin(double)`

    - #### distanceQuerySortKey

          public static double distanceQuerySortKey(double radius)

      binary search to find the exact sortKey needed to match the specified radius any sort key lte this is a query match.

    - #### relate

          public static PointValues.Relation relate(double minLat,
                                                    double maxLat,
                                                    double minLon,
                                                    double maxLon,
                                                    double lat,
                                                    double lon,
                                                    double distanceSortKey,
                                                    double axisLat)

      Compute the relation between the provided box and distance query. This only works for boxes that do not cross the dateline.

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