Details
Description
When a complex path is specified for Geometry in the SLD file:
<sld:PointSymbolizer>
<sld:Geometry>
<ogc:PropertyName>gsml:collarLocation/gsml:BoreholeCollar/gsml:location</ogc:PropertyName>
</sld:Geometry>
It will throw ServiceException:
"The requested Style can not be used with this layer. The style specifies an attribute of gsml:collarLocation/gsml:BoreholeCollar/gsml:location and the layer is: gsml:Borehole"
This is because the namespace context doesn't contain the one from the mapping file.
SLDParser needs to set the namespaces when creating PropertyName in parseGeometry(just like it does in parseFilter).
1. In SLDParser, namespaces contexted needed to be inserted in the PropertyName created in parseGeometry.
In practice, I accomplished this by moving the namespace process from the FIlterParser to the ExpressionParser, which makes more sense. Now namespaces will be encoded in all expressions of the SLD file, instead of just expressions occuring in filter tags.
Affected package: main.
2. In the StreamingRenderer, the findGeometryCS method needed to be made compatible with using xpaths for property names. This involved the same changes as I have done last year on many places of the streaming renderer: getting a descriptor or property value by evaluating the propertyname against the type or feature rather than just getting it directly by a string name.
Affected package: renderer
3. When evaluating a propertyname against a feature, a GeometryAttribute needs to be converted (unwrapped) to Geometry. I was surprised to find out none of the converters already support this. Simple features seem to return the bare Geometry usually so it is only an issue for complex features. So I made the conversion possible in the ComplexAttributeConverter
Affected package: app-schema