Package org.geotools.filter
Class CartesianDistanceFilter
Object
FilterAbstract
AbstractFilter
BinaryComparisonAbstract
GeometryFilterImpl
CartesianDistanceFilter
- All Implemented Interfaces:
Filter,MultiValuedFilter,BinarySpatialOperator,DistanceBufferOperator,SpatialOperator,FilterType
- Direct Known Subclasses:
BeyondImpl,DWithinImpl
public abstract class CartesianDistanceFilter
extends GeometryFilterImpl
implements DistanceBufferOperator
Defines geometry filters with a distance element.
These filters are defined in the filter spec by the DistanceBufferType, which contains an additioinal field for a distance. The two filters that use the distance buffer type are Beyond and DWithin.
From the spec: The spatial operators DWithin and Beyond test whether the value of a geometric property is within or beyond a specified distance of the specified literal geometric value. Distance values are expressed using the Distance element.
For now this code does not take into account the units of distance, we will assume that the filter units are the same as the geometry being filtered, and that they are cartesian.
- Author:
- Chris Holmes, TOPP
- TODO:
- REVISIT: add units for distance.
-
Nested Class Summary
Nested classes/interfaces inherited from interface MultiValuedFilter
MultiValuedFilter.MatchAction -
Field Summary
Fields inherited from class GeometryFilterImpl
matchActionFields inherited from class BinaryComparisonAbstract
expression1, expression2Fields inherited from class AbstractFilter
LOGGERFields inherited from interface FilterType
ALL, BETWEEN, COMPARE_EQUALS, COMPARE_GREATER_THAN, COMPARE_GREATER_THAN_EQUAL, COMPARE_LESS_THAN, COMPARE_LESS_THAN_EQUAL, COMPARE_NOT_EQUALS, FID, GEOMETRY_BBOX, GEOMETRY_BEYOND, GEOMETRY_CONTAINS, GEOMETRY_CROSSES, GEOMETRY_DISJOINT, GEOMETRY_DWITHIN, GEOMETRY_EQUALS, GEOMETRY_INTERSECTS, GEOMETRY_OVERLAPS, GEOMETRY_TOUCHES, GEOMETRY_WITHIN, LIKE, LOGIC_AND, LOGIC_NOT, LOGIC_OR, NONE, NULL -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedCartesianDistanceFilter(Expression e1, Expression e2, MultiValuedFilter.MatchAction matchAction) -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the passed in object is the same as this filter.doubleGets the distance allowed by this filter.Gets the units of measure that can be used to interpret the distance value held by this object.inthashCode()Override of hashCode method.voidsetDistance(double distance) Sets the distance allowed by this filter.voidtoString()Returns a string representation of this filter.Methods inherited from class GeometryFilterImpl
evaluate, evaluateInternal, getGeometries, getMatchActionMethods inherited from class BinaryComparisonAbstract
comparable, eval, eval, getExpression1, getExpression2, isMatchingCase, setExpression1, setExpression2Methods inherited from class AbstractFilter
isCompareFilter, isGeometryDistanceFilter, isGeometryFilter, isLogicFilter, isMathFilter, isSimpleFilterMethods inherited from class FilterAbstract
accepts, eval, evalMethods inherited from interface BinarySpatialOperator
getExpression1, getExpression2Methods inherited from interface MultiValuedFilter
getMatchAction
-
Constructor Details
-
CartesianDistanceFilter
-
CartesianDistanceFilter
protected CartesianDistanceFilter(Expression e1, Expression e2, MultiValuedFilter.MatchAction matchAction)
-
-
Method Details
-
setDistance
public void setDistance(double distance) Sets the distance allowed by this filter.- Parameters:
distance- the length beyond which this filter is valid or not.
-
getDistance
public double getDistance()Gets the distance allowed by this filter.- Specified by:
getDistancein interfaceDistanceBufferOperator- Returns:
- distance the length beyond which this filter is valid or not.
-
getDistanceUnits
Description copied from interface:DistanceBufferOperatorGets the units of measure that can be used to interpret the distance value held by this object. An implementation may throw an exception if these units differ from the units of the coordinate system of its geometry or the feature's geometry.- Specified by:
getDistanceUnitsin interfaceDistanceBufferOperator
-
setUnits
-
toString
Returns a string representation of this filter.- Overrides:
toStringin classGeometryFilterImpl- Returns:
- String representation of the between filter.
-
equals
Returns true if the passed in object is the same as this filter. Checks to make sure the filter types are the same as well as all three of the values.- Overrides:
equalsin classGeometryFilterImpl- Parameters:
oFilter- The filter to test equality against.- Returns:
- True if the objects are equal.
-
hashCode
public int hashCode()Override of hashCode method.- Overrides:
hashCodein classGeometryFilterImpl- Returns:
- a code to hash this object by.
-