Hello everyone, 

Looking for guidance on how I can improve Geotools to provide more
comprehensive Filter 2.0 support. Particularly where functions are
concerned. 

Recently tried parsing the following document using the FESConfiguration
(Geotools version 19.1), which appears to be valid per the spec: 



Had to fix an NPE in the binding: 
https://github.com/geotools/geotools/blob/19.1/modules/extension/xsd/xsd-filter/src/main/java/org/geotools/filter/v1_0/OGCPropertyIsLikeTypeBinding.java#L103

Did so by overriding the method in the child binding: 
https://github.com/Lambeaux/studious/blob/master/geotools/src/main/java/org/geotools/filter/v2_0/bindings/PropertyIsLikeTypeBinding.java#L78

Above document now parses, but expression access is still limited. Since the
filter 2.0 schema for LIKE should allow two expressions instead of an
expression and a string, a new LIKE impl was added to expose this. 
https://github.com/Lambeaux/studious/blob/master/geotools/src/main/java/org/geotools/filter/LikeExpressionImpl.java

For prototype purposes, I return this impl directly from the binding:
https://github.com/Lambeaux/studious/blob/master/geotools/src/main/java/org/geotools/filter/v2_0/bindings/PropertyIsLikeTypeBinding.java#L61-L73

However, it has unintended consequences. We try to lookup a "PropertyIsLike"
function, which does not exist: 
https://github.com/geotools/geotools/blob/19.1/modules/extension/xsd/xsd-filter/src/main/java/org/geotools/filter/FilterParsingUtils.java#L167

My guess was that FilterParsingUtils is just opinionated for Filter 1.0/1.1,
and grabbing all Filters/Expressions alike would solve the issue. Alas, it
does not: 
https://github.com/Lambeaux/studious/blob/master/geotools/src/main/java/org/geotools/filter/v2_0/bindings/AndBinding.java#L36

I'm going to keep digging but I get the feeling I'm going about this all
wrong. The fact that I'm modifying what appears to be generated code seems
like a red flag to me. Did I miss any crucial XML processing or plugin
documentation?



--
Sent from: http://osgeo-org.1560.x6.nabble.com/geotools-devel-f4265016.html

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to