org.apache.lucene.spatial.util

## Class GeoRelationUtils

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

-     public class GeoRelationUtils
      extends Object

  Reusable geo-relation utility methods

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `pointInRectPrecise(double lat, double lon, double minLat, double maxLat, double minLon, double maxLon)` Determine if a bbox (defined by minLat, maxLat, minLon, maxLon) contains the provided point (defined by lat, lon) NOTE: this is a basic method that does not handle dateline or pole crossing.
    `static boolean` | `rectCrosses(double aMinLat, double aMaxLat, double aMinLon, double aMaxLon, double bMinLat, double bMaxLat, double bMinLon, double bMaxLon)` Computes whether two rectangles cross
    `static boolean` | `rectIntersects(double aMinLat, double aMaxLat, double aMinLon, double aMaxLon, double bMinLat, double bMaxLat, double bMinLon, double bMaxLon)` Computes whether a rectangle intersects another rectangle (crosses, within, touching, etc)
    `static boolean` | `rectWithin(double aMinLat, double aMaxLat, double aMinLon, double aMaxLon, double bMinLat, double bMaxLat, double bMinLon, double bMaxLon)` Computes whether the first (a) rectangle is wholly within another (b) rectangle (shared boundaries allowed)

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

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

- - ### Method Detail

    - #### pointInRectPrecise

          public static boolean pointInRectPrecise(double lat,
                                                   double lon,
                                                   double minLat,
                                                   double maxLat,
                                                   double minLon,
                                                   double maxLon)

      Determine if a bbox (defined by minLat, maxLat, minLon, maxLon) contains the provided point (defined by lat, lon) NOTE: this is a basic method that does not handle dateline or pole crossing. Unwrapping must be done before calling this method.

    - #### rectWithin

          public static boolean rectWithin(double aMinLat,
                                           double aMaxLat,
                                           double aMinLon,
                                           double aMaxLon,
                                           double bMinLat,
                                           double bMaxLat,
                                           double bMinLon,
                                           double bMaxLon)

      Computes whether the first (a) rectangle is wholly within another (b) rectangle (shared boundaries allowed)

    - #### rectCrosses

          public static boolean rectCrosses(double aMinLat,
                                            double aMaxLat,
                                            double aMinLon,
                                            double aMaxLon,
                                            double bMinLat,
                                            double bMaxLat,
                                            double bMinLon,
                                            double bMaxLon)

      Computes whether two rectangles cross

    - #### rectIntersects

          public static boolean rectIntersects(double aMinLat,
                                               double aMaxLat,
                                               double aMinLon,
                                               double aMaxLon,
                                               double bMinLat,
                                               double bMaxLat,
                                               double bMinLon,
                                               double bMaxLon)

      Computes whether a rectangle intersects another rectangle (crosses, within, touching, etc)

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