Package com.geodesk.feature
Interface Filter
public interface Filter
An interface for classes that select the features to be returned by a query.
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
Checks whether the given feature should be included in the query results.default boolean
Checks whether the given feature should be included in the query results.default int
default Bounds
bounds()
The maximum bounding box in which acceptable candidates can be found.default Filter
filterForTile
(int tileNumber, Polygon tileGeometry) Returns the Filter that should be used for the given tile.default int
strategy()
Returns zero or more bit flags specified inFilterStrategy
that help the Query Engine optimize the performance of this Filter.
-
Method Details
-
strategy
default int strategy()Returns zero or more bit flags specified inFilterStrategy
that help the Query Engine optimize the performance of this Filter.- Returns:
- a bit set of strategy flags
-
accept
Checks whether the given feature should be included in the query results.- Parameters:
feature
- the feature to check- Returns:
- `true` if this feature should be included in the results
-
accept
Checks whether the given feature should be included in the query results. If `stategy()` includes `NEEDS_GEOMETRY`, `geom` must not be `null`.- Parameters:
feature
- the feature to checkgeom
- the feature's geometry- Returns:
- `true` if this feature should be included in the results
-
filterForTile
Returns the Filter that should be used for the given tile. This allows a Filter to accept all features within a certain tile, reject a tile entirely, or substitute itself with a cheaper filter. This method will only be called if `strategy()` includes `FAST_TILE_FILTER`. Note that to signal that all features should be accepted, this method returns `null` (i.e. nothing is filtered out); to reject the tile entirely, it must return `FalseFilter.INSTANCE`. It can return `this` to indicate that no shortcut filter is available for the given tile.- Parameters:
tileNumber
- the tile numbertileGeometry
- the tile polygon (an axis-aligned square)- Returns:
- the filter to use for this tile
-
bounds
The maximum bounding box in which acceptable candidates can be found.- Returns:
- a bounding box, or`null` if the filter does not use the spatial index TODO: would it be easier to just return a World bbox?
-
acceptedTypes
default int acceptedTypes()
-