org.apache.lucene.spatial.util

## Class GeoUtils

- java.lang.Object
- - org.apache.lucene.spatial.util.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` | `MAX_LAT_INCL` Maximum latitude value.
    `static double` | `MAX_LON_INCL` Maximum longitude value.
    `static double` | `MIN_LAT_INCL` Minimum latitude value.
    `static double` | `MIN_LON_INCL` Minimum longitude value.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static GeoRect` | `circleToBBox(double centerLon, double centerLat, double radiusMeters)` Compute Bounding Box for a circle using WGS-84 parameters
    `static ArrayList<double[]>` | `circleToPoly(double lon, double lat, double radiusMeters)` Converts a given circle (defined as a point/radius) to an approximated line-segment polygon
    `static boolean` | `isValidLat(double lat)` validates latitude value is within standard +/-90 coordinate bounds
    `static boolean` | `isValidLon(double lon)` validates longitude value is within standard +/-180 coordinate bounds
    `static double` | `normalizeLat(double lat_deg)` Puts latitude in range of -90 to 90.
    `static double` | `normalizeLon(double lon_deg)` Puts longitude in range of -180 to +180.
    `static GeoRect` | `polyToBBox(double[] polyLons, double[] polyLats)` Compute Bounding Box for a polygon using WGS-84 parameters

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

  - ### Method Detail

    - #### isValidLat

          public static boolean isValidLat(double lat)

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

    - #### isValidLon

          public static boolean isValidLon(double lon)

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

    - #### normalizeLon

          public static double normalizeLon(double lon_deg)

      Puts longitude in range of -180 to +180.

    - #### normalizeLat

          public static double normalizeLat(double lat_deg)

      Puts latitude in range of -90 to 90.

    - #### circleToPoly

          public static ArrayList<double[]> circleToPoly(double lon,
                                         double lat,
                                         double radiusMeters)

      Converts a given circle (defined as a point/radius) to an approximated line-segment polygon
      Parameters:
        `lon` - longitudinal center of circle (in degrees)
        `lat` - latitudinal center of circle (in degrees)
        `radiusMeters` - distance radius of circle (in meters)
      Returns:
        a list of lon/lat points representing the circle

    - #### circleToBBox

          public static GeoRect circleToBBox(double centerLon,
                             double centerLat,
                             double radiusMeters)

      Compute Bounding Box for a circle using WGS-84 parameters

    - #### polyToBBox

          public static GeoRect polyToBBox(double[] polyLons,
                           double[] polyLats)

      Compute Bounding Box for a polygon using WGS-84 parameters

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