Thanks for carefully digging into this, it does sound like a bug in the streaming rendering code. The use of full xpath expressions is a bit uncommon, so you will find and fix glitches like this as you are one of the few groups to make use of the functionality. -- Jody Garnett
On Tue, 29 Sep 2020 at 07:48, Emilio Lahr-Vivaz <elahrvi...@ccri.com> wrote: > Hello, > > We at GeoMesa recently ran into an issue with SLD and property > accessors; I'm hoping for some feedback on whether this is a bug in > geotools or something wrong in our implementation. > > We've supported JSON extensions for string-type fields for a while now. > We allow querying into the fields using a custom PropertyAccessor[1], > that will evaluate expressions in JSON-path format (e.g. "$.foo.bar"). > Given a schema with a string field named "foo", this allows one to write > a filter like `"$.foo.bar" = 10`, and the property accessor will parse > into the string-type attribute and return the appropriate leaf node. > > We ran into an issue recently where WMS requests through GeoServer that > use SLDs with our JSON-path syntax do not request the appropriate field, > so the transform fails. We traced this down to the StreamingRenderer, > which extracts the PropertyName fields, but doesn't add the attribute > name fields[2]. In our case, PropertyName is a JSON-path expression, > while attribute names contains the actual attribute that needs to be > returned. > > I made a change to add the attribute names to the extracted > properties[3], and that fixes the issue. Since this touches the > streaming renderer, I wanted to make sure that the solution makes sense > and that we aren't doing something wrong with our custom property > accessor. If so, I'm happy to put up a PR with my solution. > > Thanks, > > Emilio > > > [1]: > > https://github.com/locationtech/geomesa/blob/main/geomesa-features/geomesa-feature-kryo/src/main/scala/org/locationtech/geomesa/features/kryo/json/JsonPathPropertyAccessor.scala > [2]: > > https://github.com/geotools/geotools/blob/master/modules/library/render/src/main/java/org/geotools/renderer/lite/StreamingRenderer.java#L1817 > [3]: > > https://github.com/geotools/geotools/compare/master...elahrvivaz:wip_style_attributes_master?expand=1 > > > _______________________________________________ > GeoTools-Devel mailing list > GeoTools-Devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geotools-devel >
_______________________________________________ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel