Class SpatialOperation

java.lang.Object
org.apache.lucene.spatial.query.SpatialOperation
All Implemented Interfaces:
Serializable

public abstract class SpatialOperation extends Object implements Serializable
A predicate that compares a stored geometry to a supplied geometry. It's enum-like. For more explanation of each predicate, consider looking at the source implementation of evaluate(org.locationtech.spatial4j.shape.Shape, org.locationtech.spatial4j.shape.Shape). It's important to be aware that Lucene-spatial makes no distinction of shape boundaries, unlike many standardized definitions. Nor does it make dimensional distinctions (e.g. line vs polygon). You can lookup a predicate by "Covers" or "Contains", for example, and you will get the same underlying predicate implementation.
See Also:
WARNING: This API is experimental and might change in incompatible ways in the next release.
  • Field Details

    • BBoxIntersects

      public static final SpatialOperation BBoxIntersects
      Bounding box of the *indexed* shape, then Intersects.
    • BBoxWithin

      public static final SpatialOperation BBoxWithin
      Bounding box of the *indexed* shape, then IsWithin.
    • Contains

      public static final SpatialOperation Contains
      Meets the "Covers" OGC definition (boundary-neutral).
    • Intersects

      public static final SpatialOperation Intersects
      Meets the "Intersects" OGC definition.
    • IsEqualTo

      public static final SpatialOperation IsEqualTo
      Meets the "Equals" OGC definition.
    • IsDisjointTo

      public static final SpatialOperation IsDisjointTo
      Meets the "Disjoint" OGC definition.
    • IsWithin

      public static final SpatialOperation IsWithin
      Meets the "CoveredBy" OGC definition (boundary-neutral).
    • Overlaps

      public static final SpatialOperation Overlaps
      Almost meets the "Overlaps" OGC definition, but boundary-neutral (boundary==interior).
  • Constructor Details

    • SpatialOperation

      protected SpatialOperation(String name)
  • Method Details

    • register

      protected void register(String name)
    • get

      public static SpatialOperation get(String v)
    • values

      public static List<SpatialOperation> values()
    • is

      public static boolean is(SpatialOperation op, SpatialOperation... tst)
    • evaluate

      public abstract boolean evaluate(org.locationtech.spatial4j.shape.Shape indexedShape, org.locationtech.spatial4j.shape.Shape queryShape)
      Returns whether the relationship between indexedShape and queryShape is satisfied by this operation.
    • getName

      public String getName()
    • toString

      public String toString()
      Overrides:
      toString in class Object