Package org.apache.sis.filter
Class BinarySpatialFilter<R,G>
java.lang.Object
org.apache.sis.internal.filter.Node
org.apache.sis.filter.FilterNode<R>
org.apache.sis.filter.BinaryGeometryFilter<R,G>
org.apache.sis.filter.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>
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final SpatialOperatorName
Nature of the operation applied by thisBinarySpatialFilter
.private static final long
For cross-version compatibility.Fields inherited from class org.apache.sis.filter.BinaryGeometryFilter
context, expression1, expression2
-
Constructor Summary
ConstructorsConstructorDescriptionBinarySpatialFilter
(Geometries<G> library, Expression<? super R, ?> geometry, org.opengis.geometry.Envelope bounds, WraparoundMethod wraparound) Creates a spatial operator forSpatialOperatorName.BBOX
.BinarySpatialFilter
(SpatialOperatorName operatorType, Geometries<G> library, Expression<? super R, ?> geometry1, Expression<? super R, ?> geometry2) Creates a spatial operator all types other than BBOX. -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<?>
Returns the two expressions used as parameters by this filter.Expression<? super R,
?> Returns the first expression to be evaluated.Expression<? super R,
?> Returns the second expression to be evaluated.Identification of this operation.protected boolean
Returns the value to return when a test cannot be applied.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.boolean
Given an object, determines if the test(s) represented by this filter are passed.Methods inherited from class org.apache.sis.filter.BinaryGeometryFilter
getExpressions, optimize, original
Methods inherited from class org.apache.sis.filter.FilterNode
and, negate, or
Methods inherited from class org.apache.sis.internal.filter.Node
createName, createType, equals, getGeometryLibrary, hashCode, symbol, toGeometryWrapper, toString, unwrap, warning
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.sis.filter.Optimization.OnFilter
and, negate, or, recreate
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
operatorType
Nature of the operation applied by thisBinarySpatialFilter
.
-
-
Constructor Details
-
BinarySpatialFilter
BinarySpatialFilter(Geometries<G> library, Expression<? super R, ?> geometry, org.opengis.geometry.Envelope bounds, WraparoundMethod wraparound) Creates a spatial operator forSpatialOperatorName.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 thisBinarySpatialFilter
.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 classBinaryGeometryFilter<R,
G>
-
getOperatorType
Identification of this operation.- Returns:
- the nature of this operator.
-
getOperand1
Returns the first expression to be evaluated. -
getOperand2
Returns the second expression to be evaluated. -
getChildren
Returns the two expressions used as parameters by this filter.- Specified by:
getChildren
in classNode
- Returns:
- the children of this node, or an empty collection if none.
-
test
Given an object, determines if the test(s) represented by this filter are passed.- Parameters:
object
- the object (often aFeature
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 classBinaryGeometryFilter<R,
G>
-