Stefan Hansen ha scritto:
> Dear list!
>
> There is another small problem in
> org.geotools.filter.visitor.PostPreProcessFilterSplittingVisitor.java. This
> time in the function Object visit(BBOX filter, Object notUsed).
>
> Whenever I used a BBOX-filter with WFS-datastore, it got treated as a
> postfilter, because the the data store always returned false for
> supports(BBOX.class). Even though the cascaded WFS does support BBOX-filters.
> However, when the capabilites of the cascaded WFS are parsed the ability to
> support BBOX-filters is set as FilterCapabilities.SPATIAL_BBOX. And
> supports(FilterCapabilities.SPATIAL_BBOX) returns true, even if
> supports(BBOX.class) is false.
>
> Here is the code snippet that causes the problem:
>
> public Object visit(BBOX filter, Object notUsed) {
> if (!fcs.supports(BBOX.class)) {
> postStack.push(filter);
> } else {
> preStack.push(filter);
> }
> return null;
> }
>
> And my suggestion to solve this issue is:
>
> public Object visit(BBOX filter, Object notUsed) {
> if (fcs.supports(FilterCapabilities.SPATIAL_BBOX) ||
> fcs.supports(BBOX.class)) {
> preStack.push(filter);
> } else {
> postStack.push(filter);
> }
> return null;
> }
>
> Maybe fcs.supports(BBOX.class) could be removed, but maybe it is used by
> another data store. So far it doesn't hurt...
Hmmm... the real fix is to declare the filter capabilities
in both ways, both the old (geotools filters) and the new (geoapi
filters) way. What you're proposing makes usage of the old filters
even wider and we don't want that, especially in a class that's
supposed to be gt2-filter-free.
This is how it has been done in Postgis datastore:
http://svn.geotools.org/geotools/branches/2.4.x/modules/plugin/postgis/src/main/java/org/geotools/filter/SQLEncoderPostgis.java
(see the createFilterCapabilities() method).
The problem has been known for quite some time, I already pointed
out Tim Englich to this solution since he was reporting a similar
problem, but it seems the issue is stuck
on whoever is the mantainers of the wfs module these days (or else,
on the lack of a maintainer).
Cheers
Andrea
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel