Simplify FilterFactory
Jody Garnett edited this page May 25, 2021
·
3 revisions
- Contact: jodygarnett
- Tracker: https://osgeo-org.atlassian.net/browse/GEOT-3056
- TLDR: Combine FilterFactory and FilterFactory2
- Branch: pending
Update FilterFactory interface with methods from FilterFactory2.
Default methods for methods that are not supported may be a useful approach.
Formally this is the difference between:
- FilterFactory - strictly limited to the data structure defined by Filter specifications
- FilterFactory2 - allows for extensions unique to the GeoTools project
References:
- Support for three dimensional envelopes and bounding box filters
- Support Multi-Valued Attributes in Filter Comparison Operators
- Temporal Filters - proposal extending FilterFactory rather than introducing FilterFactory3
- FilterFactory cleanup - Pull up methods from FilterFactory2
Choose one of:
- Under Discussion
- In Progress
- Completed
- Rejected,
- Deferred
Voting:
- Andrea Aime:
- Ian Turton:
- Jody Garnett: +1
- Nuno Oliveira:
- Simone Giannecchini:
- Torben Barsballe:
-
Moves all methods into FilterFactory
-
Pull up methods into FilterFactory; update javadocs to indicate what is strict OGC (for anyone who cares).
-
Allow methods that expected a literal ISO Geometry to accept a JTS geometry.
- Change methods using an ISO Geometry to take a Object instead
-
Add default methods to FilterFactory to reduce the amount of coding required by implementations.
Before:
public interface FilterFactory {
...
/** Checks if the feature's geometry touches, but does not overlap with the geometry held by this object. */
Touches touches(String propertyName, Geometry geometry);
...
}
public interface FilterFactory2 extends FilterFactory {
/** Checks if the feature's geometry touches, but does not overlap with the geometry held by this object. */
Touches touches(Expression propertyName1, Expression geometry2);
}
After:
public interface FilterFactory {
...
/**
* Checks if the feature's geometry touches, but does not overlap with the geometry held by this object.
*
* Defined as a propertyName and literal geometry comparison following OGC Filter and CQL specifications.
*/
Touches touches(String propertyName, Object geometry) {
return touches( property(propertyName), literal(geometry) );
}
/**
* Checks if the feature's geometry touches, but does not overlap with a second geometry.
*/
Touches touches(Expression geometry1, Expression geometry2);
...
}
public interface FilterFactory2 extends FilterFactory {
// empty
}