Class BinarySpatialFilter<R,G>

Type Parameters:
R - the type of resources (e.g. Feature) used as inputs.
G - the implementation type of geometry objects.
All Implemented Interfaces:
Serializable, Predicate<R>, Filter<R>, Optimization.OnFilter<R>

final class BinarySpatialFilter<R,G> extends BinaryGeometryFilter<R,G>
Spatial operations between two geometries. The nature of the operation depends on getOperatorType(). A standard set of spatial operators is equal, disjoin, touches, within, overlaps, crosses, intersects, contains, beyond and BBOX.
Since:
1.1
Version:
1.1
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • operatorType

      private final SpatialOperatorName operatorType
      Nature of the operation applied by this BinarySpatialFilter.
  • Constructor Details

    • BinarySpatialFilter

      BinarySpatialFilter(Geometries<G> library, Expression<? super R,?> geometry, org.opengis.geometry.Envelope bounds, WraparoundMethod wraparound)
      Creates a spatial operator for SpatialOperatorName.BBOX.
      Parameters:
      library - the geometry library to use.
      geometry - expression fetching the geometry to check for interaction with bounds.
      bounds - the bounds to check geometry against.
    • BinarySpatialFilter

      BinarySpatialFilter(SpatialOperatorName operatorType, Geometries<G> library, Expression<? super R,?> geometry1, Expression<? super R,?> geometry2)
      Creates a spatial operator all types other than BBOX.
      Parameters:
      operatorType - nature of the operation applied by this BinarySpatialFilter.
      library - the geometry library to use.
      geometry1 - expression fetching the first geometry of the binary operator.
      geometry2 - expression fetching the second geometry of the binary operator.
  • Method Details

    • recreate

      protected BinaryGeometryFilter<R,G> recreate(Expression<? super R,?> geometry1, Expression<? super R,?> geometry2)
      Recreates a new filter of the same type and with the same parameters, but using the given expressions. This method is invoked when it is possible to simplify or optimize at least one of the expressions that were given in the original call to the constructor.
      Specified by:
      recreate in class BinaryGeometryFilter<R,G>
    • getOperatorType

      public SpatialOperatorName getOperatorType()
      Identification of this operation.
      Returns:
      the nature of this operator.
    • getOperand1

      public Expression<? super R,?> getOperand1()
      Returns the first expression to be evaluated.
    • getOperand2

      public Expression<? super R,?> getOperand2()
      Returns the second expression to be evaluated.
    • getChildren

      protected Collection<?> getChildren()
      Returns the two expressions used as parameters by this filter.
      Specified by:
      getChildren in class Node
      Returns:
      the children of this node, or an empty collection if none.
    • test

      public boolean test(R object)
      Given an object, determines if the test(s) represented by this filter are passed.
      Parameters:
      object - the object (often a Feature instance) to evaluate.
      Returns:
      true if the test(s) are passed for the provided object.
    • negativeResult

      protected boolean negativeResult()
      Returns the value to return when a test cannot be applied.
      Specified by:
      negativeResult in class BinaryGeometryFilter<R,G>