Inconsistent use of namedlayer/userlayer when exporting sld from grid layer and vector layer. When sld from vector layer is exported the namedlayer element is correctly applied, when exporting from grid layer, the UserLayer element in incorrectly used.
11.3 User-defined layers
In addition to using named layers, it is also useful to be able to define custom userdefined layers for rendering. The Schema fragment for user-defined layers is as follows:
My impression is that QGIS incorrectly uses the userlayer element for grid layers in generated SLD when exporting SLD 1.0 for a grid layer. The 'namedlayer' element seems more appropriate.
Additional context
At the moment Mapserver is not able to render SLD's exported from grids in QGIS, because it only supports the namedLayer element in SLD.
Feature description
Inconsistent use of namedlayer/userlayer when exporting sld from grid layer and vector layer. When sld from vector layer is exported the namedlayer element is correctly applied, when exporting from grid layer, the
UserLayer
element in incorrectly used.The different behavior seems related to the use of SLD 1.0 vs SLD 1.1 for grid layers at https://github.com/qgis/QGIS/blob/38e955291af9d45ef04795adf080c698dd3c2e30/src/core/qgsmaplayer.cpp#L2203-L2216
When reading the sld spec, but also in the 1.0 spec:
My impression is that QGIS incorrectly uses the
userlayer
element for grid layers in generated SLD when exporting SLD 1.0 for a grid layer. The 'namedlayer' element seems more appropriate.Additional context
At the moment Mapserver is not able to render SLD's exported from grids in QGIS, because it only supports the namedLayer element in SLD.