Bug report #10076

SLD file generation

Added by roberto loperfido over 10 years ago. Updated over 8 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Symbology
Affected QGIS version:2.2.0 Regression?:No
Operating System:win32 Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:18546

Description

we noticed that Qgis 2.2.0 (32-bit) on Windows generation SLD file is not compatible with Geoserver 2.3.4 (Linux) - attach a picture of the error validation.
In order to reproduce the error we send you the shape file (ESRI) zone_colorate.shp and SLD files generated by Qgis 2 and SLD edited the file manually (and properly validated by Geoserver)

segnalazione.zip - data and image (90.6 KB) roberto loperfido, 2014-04-15 05:37 AM


Related issues

Related to QGIS Application - Bug report #11202: Invalid SLD generated Closed 2014-09-13

Associated revisions

Revision 1140437f
Added by Andrea Aime over 8 years ago

Do not generate a ogc:Filter where a ogc:Expression is expected. Fixes #10076 and #11202

Revision 5c4fd978
Added by Andrea Aime about 8 years ago

Do not generate a ogc:Filter where a ogc:Expression is expected. Fixes #10076 and #11202

Revision 7cecbeb2
Added by Andrea Aime about 8 years ago

Do not generate a ogc:Filter where a ogc:Expression is expected. Fixes #10076 and #11202

Revision b6274013
Added by Andrea Aime about 8 years ago

Do not generate a ogc:Filter where a ogc:Expression is expected. Fixes #10076 and #11202

History

#1 Updated by Andrea Aime over 8 years ago

I've checked, indeed the generated SLD is not compliant with the specification, this is the invalid bit repeated multiple times in the document:

<se:Rotation>
   <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
      <ogc:Literal>45</ogc:Literal>
   </ogc:Filter>
</se:Rotation>

A filter can only be added at the top of the rule to select the features to be painted, the rotation element needs to contain an expression instead. This is the valid syntax:

<se:Rotation>
  <ogc:Literal>45</ogc:Literal>
</se:Rotation>

#2 Updated by Andrea Aime over 8 years ago

So far I've tracked the rotation element generation here:
https://github.com/qgis/QGIS/blob/master/src/core/symbology-ng/qgssymbollayerv2utils.cpp#L2306
and inside it calls createFunctionElement which turns a QGis expression into a OGC filter instead of a OGC expression

#3 Updated by Andrea Aime over 8 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF