Package org.locationtech.spatial4j
Class SpatialPredicate
- java.lang.Object
-
- org.locationtech.spatial4j.SpatialPredicate
-
- All Implemented Interfaces:
java.io.Serializable
public abstract class SpatialPredicate extends java.lang.Object implements java.io.SerializableA 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 ofevaluate(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.
-
-
Field Summary
Fields Modifier and Type Field Description static SpatialPredicateBBoxIntersectsBounding box of the *indexed* shape, thenIntersects.static SpatialPredicateBBoxWithinBounding box of the *indexed* shape, thenIsWithin.static SpatialPredicateContainsMeets the "Covers" OGC definition (boundary-neutral).static SpatialPredicateIntersectsMeets the "Intersects" OGC definition.static SpatialPredicateIsDisjointToMeets the "Disjoint" OGC definition.static SpatialPredicateIsEqualToMeets the "Equals" OGC definition.static SpatialPredicateIsWithinMeets the "CoveredBy" OGC definition (boundary-neutral).private static java.util.List<SpatialPredicate>listprivate java.lang.Stringnamestatic SpatialPredicateOverlapsAlmost meets the "Overlaps" OGC definition, but boundary-neutral (boundary==interior).private static java.util.Map<java.lang.String,SpatialPredicate>registry
-
Constructor Summary
Constructors Modifier Constructor Description protectedSpatialPredicate(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleanevaluate(Shape indexedShape, Shape queryShape)Returns whether the relationship between indexedShape and queryShape is satisfied by this operation.static SpatialPredicateget(java.lang.String v)java.lang.StringgetName()static booleanis(SpatialPredicate op, SpatialPredicate... tst)protected voidregister(java.lang.String name)java.lang.StringtoString()static java.util.List<SpatialPredicate>values()
-
-
-
Field Detail
-
registry
private static final java.util.Map<java.lang.String,SpatialPredicate> registry
-
list
private static final java.util.List<SpatialPredicate> list
-
BBoxIntersects
public static final SpatialPredicate BBoxIntersects
Bounding box of the *indexed* shape, thenIntersects.
-
BBoxWithin
public static final SpatialPredicate BBoxWithin
Bounding box of the *indexed* shape, thenIsWithin.
-
Contains
public static final SpatialPredicate Contains
Meets the "Covers" OGC definition (boundary-neutral).
-
Intersects
public static final SpatialPredicate Intersects
Meets the "Intersects" OGC definition.
-
IsEqualTo
public static final SpatialPredicate IsEqualTo
Meets the "Equals" OGC definition.
-
IsDisjointTo
public static final SpatialPredicate IsDisjointTo
Meets the "Disjoint" OGC definition.
-
IsWithin
public static final SpatialPredicate IsWithin
Meets the "CoveredBy" OGC definition (boundary-neutral).
-
Overlaps
public static final SpatialPredicate Overlaps
Almost meets the "Overlaps" OGC definition, but boundary-neutral (boundary==interior).
-
name
private final java.lang.String name
-
-
Method Detail
-
register
protected void register(java.lang.String name)
-
get
public static SpatialPredicate get(java.lang.String v)
-
values
public static java.util.List<SpatialPredicate> values()
-
is
public static boolean is(SpatialPredicate op, SpatialPredicate... tst)
-
evaluate
public abstract boolean evaluate(Shape indexedShape, Shape queryShape)
Returns whether the relationship between indexedShape and queryShape is satisfied by this operation.
-
getName
public java.lang.String getName()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-