Hello geotools community,
maybe I discovered another bug in the wfs implementation of geotools. Or I just
can not configure everything correctly
I want to get a feature from a wfs server with wfs 2.0 (Web Feature Service
2.0. (ISO 19142)) and fes 2.0 (Filter Encoding Standard (FES) 2.0 (ISO 19143)).
But geotools looks in the fes 2.0 conform capabilities (PropertyIsEqualTo) for
a ogc filtername (EqualTo). So geotools thinks, the server does not support the
requested filter.
The question is, is it already possible to use wfs 2.0 with fes 2.0 in
geotools? Or is a special configuration needed, which I forgot?
Here is a code example:
final ContentFeatureSource source = ...
final Filter filter = CQL.toFilter("ags = '09162000'", null);
final FeatureReader<SimpleFeatureType, SimpleFeature> features =
source.getReader(filter);
Geotools thinks, this filter is not supported from the wfs server. So geotools
just grabs all the features from the Server :( And than makes the filtering
itself. This is the problem, because the Server should to do the filtering
itself.
The details of the problematic code:
The created filter from the statement above is
org.geotools.filter.IsEqualsToImpl.
The code which desides if the filter is supported or unsupported is in class
org.geotools.data.wfs.internal.v2_0.StrictWFS_2_0_Strategy in method
createGetFeatureRequestPost.
The splitting between supported filters and unsupported filters is made in
class org.geotools.filter.visitor.CapabilitiesFilterSplitter in method
visitBinaryOperator.
The comparising happens in class
org.geotools.filter.visitor.IsSupportedFilterVisitor:
public Object visit( PropertyIsEqualTo filter, Object extraData ) {
ScalarCapabilities scalar = capabilities.getScalarCapabilities();
if( scalar == null ) return false;
ComparisonOperators operators = scalar.getComparisonOperators();
if( operators == null ) return false;
return operators.getOperator( PropertyIsEqualTo.NAME ) != null;
}
So for the comparing the code uses the ogc filtername EqualTo and the
filternames in the capabilities from fes 2.0 (PropertyIsEqualTo). Obviously the
filtername is not found in the capabilities.
What do you think of this problem?
Greatings,
Matthias Schulze (matthias24 on github)
Mit freundlichen Grüßen
Matthias Schulze
--
Matthias Schulze
Landesamt für Digitalisierung, Breitband und Vermessung
Alexandrastraße 4, 80538 München
Adressansicht im
BayernAtlas<http://geoportal.bayern.de/bayernatlas?Y=4469627&X=5333820&zoom=13&crosshair=marker>
Telefon: +49 (89) 2129 1561
E-Mail: [email protected]<mailto:[email protected]>
Internet: http://www.geodaten.bayern.de<http://www.geodaten.bayern.de/>
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel