Hi all,
Part of WFS 2.0 is the new filter encoding spec (FES 2.0), which brings in
temporal filters. The temporal component of the spec adds 14 new operators.
I have listed them on this wiki page, along with the semantics as I
understand them.
http://docs.codehaus.org/display/GEOTOOLS/Temporal+Filter+Support
I have been experimenting with supporting this in geotools and wanted to
share my findings and hopefully come up with a plan.
* gt-temporal
While searching around the code base I ran into this module. Not sure how it
is really used but the module maintainers are:
Mehdi Sidhoum
Alessio
Simone
Daniele
Looking at what depends on the module the only one i can find is
unsupported/coverage-experiment. Not sure what its current status is but I
did find some pretty useful stuff. First there is an object model that
represents things like TimeInstance and TimePeriod. This makes it easy to
create bindings for associated GML constructs rather than try to shove them
into java.util.Date and the like.
The other (even more useful) thing is that the module implements all the
above operators. So it makes implementing the filters actually quite
trivial.
* Temporal classes or no temporal classes?
To support the temporal filter model we have a few choices:
1. Create the temporal filter interfaces in opengis and associated classes
in main. Basically following suit with how other filters work. THis is more
or less the approach I have been experimenting with. The result can be found
here:
https://github.com/jdeolive/geotools/tree/temporal_filter/modules/library/opengis/src/main/java/org/opengis/filter/temporal
https://github.com/jdeolive/geotools/tree/temporal_filter/modules/library/main/src/main/java/org/geotools/filter/temporal
This one also involves updating FilterFactory and the like:
https://github.com/jdeolive/geotools/blob/temporal_filter/modules/library/opengis/src/main/java/org/opengis/filter/FilterFactory.java#L326
And the interesting one is FilterVisitor. This one is somewhat problematic
due to the number of implementations of the FilterVisitor interface that
exist. So adding the required methods to it will result in a lot of
breakage. And while we do have base classes that people are intended to
extend, most implementations I have come across do not, and implement the
interface directly.
An alternative would be to come up with a subinterface, called
TemporalFilterVisitor, and add the temporal visit methods to it.
2. Rather than defining the new interfaces we could also try to support
temporal filters by actually representing them with the existing filter
constructs we have. For example representing Before with PropertyIsLessThan,
During with PropertyIsBetween, etc... If i am not mistaken this is how CQL
supports its subset of temporal constructs.
3. A slight spin on (2) is the idea of using filter functions to represent
the temporal stuff. This would handle cases where perhaps it is hard to
represent the temporal operator with just the existing constructs. For
instance Meets or MetBy... its not evident to me how this would map over.
Looking at the tradeoffs... 2/3 has the benefit of not requiring any api
changes. But at the same time it sort of seems a bit hackish. 1 seems like
the cleaner way to proceed but again will require some api changes. Thoughts
and feedback welcome here.
* Summary
To sum up I pose a few questions.
1. How do people feel about using the gt-temporal module, and in particular
adding it as a dependency of main
2. Do people prefer approach (1), or (2/3). Or please do present another
option.
3. Assuming (1) should we simply add to the FilterVisitor interface breaking
direct implementations, or come up with subinterface or the like to capture
the temporal methods so that we do not break client code. If we do think the
latter is a good idea then perhaps it makes sense to do the same for filter
factory.
Thanks folks.
-Justin
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel