Class LatLonShapeBoundingBoxQuery.EncodedRectangle

java.lang.Object
org.apache.lucene.document.LatLonShapeBoundingBoxQuery.EncodedRectangle
Enclosing class:
LatLonShapeBoundingBoxQuery

private static class LatLonShapeBoundingBoxQuery.EncodedRectangle extends Object
Holds spatial logic for a bounding box that works in the encoded space
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final byte[]
     
    private final boolean
     
    protected final int
     
    protected final int
     
    protected final int
     
    protected final int
     
    private final byte[]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    EncodedRectangle(double minLat, double maxLat, double minLon, double maxLon)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    compareBBoxToRangeBBox(byte[] bbox, int minXOffset, int minYOffset, byte[] minTriangle, int maxXOffset, int maxYOffset, byte[] maxTriangle)
    static utility method to compare a bbox with a range of triangles (just the bbox of the triangle collection)
    (package private) boolean
    contains(int x, int y)
    Checks if the rectangle contains the provided point
    (package private) boolean
    containsLine(int aX, int aY, int bX, int bY)
    Checks if the rectangle contains the provided LINE
    (package private) boolean
    containsTriangle(int aX, int aY, int bX, int bY, int cX, int cY)
    Checks if the rectangle contains the provided triangle
    private boolean
     
    private boolean
    disjoint(byte[] bbox, int minXOffset, int minYOffset, byte[] minTriangle, int maxXOffset, int maxYOffset, byte[] maxTriangle)
    static utility method to check a bbox is disjoint with a range of triangles
    private static boolean
    edgeIntersectsBox(int aX, int aY, int bX, int bY, int minX, int maxX, int minY, int maxY)
    returns true if the edge (defined by (aX, aY) (bX, bY)) intersects the box
    private boolean
    edgeIntersectsQuery(int aX, int aY, int bX, int bY)
    returns true if the edge (defined by (aX, aY) (bX, bY)) intersects the query
    private static void
    encode(int minX, int maxX, int minY, int maxY, byte[] b)
    encodes a bounding box into the provided byte array
    intersectBBoxWithRangeBBox(byte[] bbox, int minXOffset, int minYOffset, byte[] minTriangle, int maxXOffset, int maxYOffset, byte[] maxTriangle)
    static utility method to compare a bbox with a range of triangles (just the bbox of the triangle collection) for intersection
    (package private) PointValues.Relation
    intersectRangeBBox(int minXOffset, int minYOffset, byte[] minTriangle, int maxXOffset, int maxYOffset, byte[] maxTriangle)
    intersects this to a provided range bounding box
    (package private) boolean
    intersectsLine(int aX, int aY, int bX, int bY)
    Checks if the rectangle intersects the provided LINE
    (package private) boolean
    intersectsTriangle(int aX, int aY, int bX, int bY, int cX, int cY)
    Checks if the rectangle intersects the provided triangle
    (package private) PointValues.Relation
    relateRangeBBox(int minXOffset, int minYOffset, byte[] minTriangle, int maxXOffset, int maxYOffset, byte[] maxTriangle)
    compare this to a provided range bounding box
    (package private) Component2D.WithinRelation
    withinLine(int aX, int aY, boolean ab, int bX, int bY)
    Returns the Within relation to the provided triangle
    (package private) Component2D.WithinRelation
    withinTriangle(int aX, int aY, boolean ab, int bX, int bY, boolean bc, int cX, int cY, boolean ca)
    Returns the Within relation to the provided triangle

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • bbox

      protected final byte[] bbox
    • west

      private final byte[] west
    • minX

      protected final int minX
    • maxX

      protected final int maxX
    • minY

      protected final int minY
    • maxY

      protected final int maxY
    • crossesDateline

      private final boolean crossesDateline
  • Constructor Details

    • EncodedRectangle

      EncodedRectangle(double minLat, double maxLat, double minLon, double maxLon)
  • Method Details

    • encode

      private static void encode(int minX, int maxX, int minY, int maxY, byte[] b)
      encodes a bounding box into the provided byte array
    • crossesDateline

      private boolean crossesDateline()
    • relateRangeBBox

      PointValues.Relation relateRangeBBox(int minXOffset, int minYOffset, byte[] minTriangle, int maxXOffset, int maxYOffset, byte[] maxTriangle)
      compare this to a provided range bounding box
    • intersectRangeBBox

      PointValues.Relation intersectRangeBBox(int minXOffset, int minYOffset, byte[] minTriangle, int maxXOffset, int maxYOffset, byte[] maxTriangle)
      intersects this to a provided range bounding box
    • compareBBoxToRangeBBox

      private PointValues.Relation compareBBoxToRangeBBox(byte[] bbox, int minXOffset, int minYOffset, byte[] minTriangle, int maxXOffset, int maxYOffset, byte[] maxTriangle)
      static utility method to compare a bbox with a range of triangles (just the bbox of the triangle collection)
    • intersectBBoxWithRangeBBox

      private PointValues.Relation intersectBBoxWithRangeBBox(byte[] bbox, int minXOffset, int minYOffset, byte[] minTriangle, int maxXOffset, int maxYOffset, byte[] maxTriangle)
      static utility method to compare a bbox with a range of triangles (just the bbox of the triangle collection) for intersection
    • disjoint

      private boolean disjoint(byte[] bbox, int minXOffset, int minYOffset, byte[] minTriangle, int maxXOffset, int maxYOffset, byte[] maxTriangle)
      static utility method to check a bbox is disjoint with a range of triangles
    • contains

      boolean contains(int x, int y)
      Checks if the rectangle contains the provided point
    • intersectsLine

      boolean intersectsLine(int aX, int aY, int bX, int bY)
      Checks if the rectangle intersects the provided LINE
    • intersectsTriangle

      boolean intersectsTriangle(int aX, int aY, int bX, int bY, int cX, int cY)
      Checks if the rectangle intersects the provided triangle
    • containsLine

      boolean containsLine(int aX, int aY, int bX, int bY)
      Checks if the rectangle contains the provided LINE
    • containsTriangle

      boolean containsTriangle(int aX, int aY, int bX, int bY, int cX, int cY)
      Checks if the rectangle contains the provided triangle
    • withinLine

      Component2D.WithinRelation withinLine(int aX, int aY, boolean ab, int bX, int bY)
      Returns the Within relation to the provided triangle
    • withinTriangle

      Component2D.WithinRelation withinTriangle(int aX, int aY, boolean ab, int bX, int bY, boolean bc, int cX, int cY, boolean ca)
      Returns the Within relation to the provided triangle
    • edgeIntersectsQuery

      private boolean edgeIntersectsQuery(int aX, int aY, int bX, int bY)
      returns true if the edge (defined by (aX, aY) (bX, bY)) intersects the query
    • edgeIntersectsBox

      private static boolean edgeIntersectsBox(int aX, int aY, int bX, int bY, int minX, int maxX, int minY, int maxY)
      returns true if the edge (defined by (aX, aY) (bX, bY)) intersects the box