Package org.geotools.filter.visitor
Class ExtractBoundsFilterVisitor
- Object
-
- NullFilterVisitor
-
- ExtractBoundsFilterVisitor
-
- All Implemented Interfaces:
ExpressionVisitor
,FilterVisitor
public class ExtractBoundsFilterVisitor extends NullFilterVisitor
Extract a maximal envelope from the provided Filter.The maximal envelope is generated from:
- all the literal geometry instances involved if spatial operations - using geom.getEnvelopeInternal().
- Filter.EXCLUDES will result in an empty envelope
- Filter.INCLUDES will result in a "world" envelope with range Double.NEGATIVE_INFINITY to Double.POSITIVE_INFINITY for each axis.
- all other non spatial filters will result in a world envelope
- combinations in and will return the intersection of the envelopes, or an empty envelope if an exclude is in the mix, or null if the and is mixing non spatial filters
- combinations in or will return the intersection of
You can also call this function with an existing Envelope; if you are building up bounds based on several filters.ReferencedEnvelope bbox = (ReferencedEnvelope) filter.accepts(new ExtractBoundsFilterVisitor(), dataCRS );
This is a replacement for FilterConsumer.
- Author:
- Jody Garnett
-
-
Field Summary
Fields Modifier and Type Field Description static NullFilterVisitor
BOUNDS_VISITOR
-
Fields inherited from class NullFilterVisitor
NULL_VISITOR
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ExtractBoundsFilterVisitor()
This FilterVisitor is stateless - use ExtractBoundsFilterVisitor.BOUNDS_VISITOR.
-
Method Summary
-
Methods inherited from class NullFilterVisitor
visit
-
-
-
-
Field Detail
-
BOUNDS_VISITOR
public static NullFilterVisitor BOUNDS_VISITOR
-
-
Method Detail
-
visit
public Object visit(ExcludeFilter filter, Object data)
Description copied from interface:FilterVisitor
VisitFilter.EXCLUDE
(often used during data structure transformations).- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
- Parameters:
filter
-Filter.EXCLUDE
.data
- Value object provided to visitor- Returns:
- subclass supplied
-
visit
public Object visit(IncludeFilter filter, Object data)
Description copied from interface:FilterVisitor
VisitFilter.INCLUDE
(often used during data structure transformations).- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
- Parameters:
filter
-Filter.INCLUDE
.data
- Value object provided to visitor- Returns:
- subclass supplied
-
infinity
protected Envelope infinity()
-
visit
public Object visit(BBOX filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Literal expression, Object data)
Please note we are only visiting literals involved in spatial operations.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classNullFilterVisitor
- Parameters:
expression
- a literal expression, hopefully a Geometry or Envelopedata
- Incoming BoundingBox (or Envelope or CRS)- Returns:
- ReferencedEnvelope updated to reflect literal
-
visit
public Object visit(And filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Not filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Or filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Beyond filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Contains filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Crosses filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Disjoint filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(DWithin filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Equals filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Intersects filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Overlaps filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Touches filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Within filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Add expression, Object data)
- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Divide expression, Object data)
- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Function expression, Object data)
- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Id filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Multiply expression, Object data)
- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(NilExpression expression, Object data)
Description copied from interface:ExpressionVisitor
Used to visit a Expression.NIL, also called fornull
where an expression is expected.This is particularly useful when doing data transformations, as an example when using a StyleSymbolizer Expression.NIL can be used to represent the default stroke color.
- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classNullFilterVisitor
- Returns:
- implementation specific
-
visit
public Object visit(PropertyIsBetween filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(PropertyIsEqualTo filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(PropertyIsGreaterThan filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(PropertyIsGreaterThanOrEqualTo filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(PropertyIsLessThan filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(PropertyIsLessThanOrEqualTo filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(PropertyIsLike filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(PropertyIsNotEqualTo filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(PropertyIsNull filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(PropertyName expression, Object data)
- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Subtract expression, Object data)
- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visitNullFilter
public Object visitNullFilter(Object data)
Description copied from interface:FilterVisitor
Used to account for anull
filter value.This is particularly used during data structure transofrmations, however the use of
null
is not recommended. Please make use of Filter.NONE and Filter.ALL as placeholder objects that communicate intent.- Specified by:
visitNullFilter
in interfaceFilterVisitor
- Overrides:
visitNullFilter
in classNullFilterVisitor
- Parameters:
data
- Value object provided to visitor- Returns:
- subclass defined
-
visit
public Object visit(After after, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(AnyInteracts anyInteracts, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Before before, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Begins begins, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(BegunBy begunBy, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(During filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(EndedBy endedBy, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Ends ends, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Meets meets, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(MetBy metBy, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(OverlappedBy overlappedBy, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(TContains contains, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(TEquals equals, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(TOverlaps contains, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(PropertyIsNil filter, Object data)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
-