Class GeospatialPredicateEvaluators.GeographyEvaluator

java.lang.Object
org.apache.iceberg.geospatial.GeospatialPredicateEvaluators.GeographyEvaluator
All Implemented Interfaces:
GeospatialPredicateEvaluators.GeospatialPredicateEvaluator
Enclosing class:
GeospatialPredicateEvaluators

public static class GeospatialPredicateEvaluators.GeographyEvaluator extends Object implements GeospatialPredicateEvaluators.GeospatialPredicateEvaluator
  • Constructor Details

    • GeographyEvaluator

      public GeographyEvaluator()
  • Method Details

    • intersects

      public boolean intersects(BoundingBox bbox1, BoundingBox bbox2)
      Check if two bounding boxes intersect, taking wrap-around into account.

      Wraparound (or antimeridian crossing) occurs when a geography crosses the 180°/-180° longitude line on a map. In these cases, the minimum X value is greater than the maximum X value (xmin > xmax). This represents a bounding box that wraps around the globe.

      For example, a bounding box with xmin=170° and xmax=-170° represents an area that spans from 170° east to 190° east (or equivalently, -170° west). This is important for geometries that cross the antimeridian, like a path from Japan to Alaska.

      When xmin > xmax, a point matches if its X coordinate is either X ≥ xmin OR X ≤ xmax, rather than the usual X ≥ xmin AND X ≤ xmax. In geographic terms, if the westernmost longitude is greater than the easternmost longitude, this indicates an antimeridian crossing.

      Specified by:
      intersects in interface GeospatialPredicateEvaluators.GeospatialPredicateEvaluator
      Parameters:
      bbox1 - the first bounding box
      bbox2 - the second bounding box
      Returns:
      true if the bounding boxes intersect