Bug report #9365

QGIS save as SLD style for graduated styled layer different from what it's shown in QGIS

Added by stefano nardone over 10 years ago. Updated over 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Symbology
Affected QGIS version:2.0.1 Regression?:No
Operating System:Linux Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:17965

Description

I've found that when applying a graduated style to a layer in QGIS, if I save the style as SLD to use it in my Geoserver, then the SLD rendered layer looks different.

So I've made a small example: !IMAGE 1!

The layer contains 4 elemtents, with a feature value that is 1,2,3,4 for each.

  • First color style class represents values from 1 (included) to 2 (included)
  • 2nd style class represents values > 2 and <= 3 (right?)
  • 3td style class represents values > 3 and <= 4

but the Geoserver WMS rendered result with the same QGIS style saved as SLD is: !IMAGE 2!

where the polygon with feature value = 1 is missing. In fact the exported SLD contains instruction to style values > 1 and <= 2 for the first style class:

&lt;se:Rule&gt;
&lt;se:Name&gt;1.0000 - 2.0000&lt;/se:Name&gt;
&lt;se:Description&gt;
&lt;se:Title&gt;1.0000 - 2.0000&lt;/se:Title&gt;
&lt;/se:Description&gt;
&lt;ogc:Filter&gt;
&lt;ogc:And&gt;
&lt;ogc:PropertyIsGreaterThan&gt;
&lt;ogc:PropertyName&gt;somedata&lt;/ogc:PropertyName&gt;
&lt;ogc:Literal&gt;1&lt;/ogc:Literal&gt;
&lt;/ogc:PropertyIsGreaterThan&gt;
&lt;ogc:PropertyIsLessThanOrEqualTo&gt;
&lt;ogc:PropertyName&gt;somedata&lt;/ogc:PropertyName&gt;
&lt;ogc:Literal&gt;2&lt;/ogc:Literal&gt;
&lt;/ogc:PropertyIsLessThanOrEqualTo&gt;
&lt;/ogc:And&gt;
&lt;/ogc:Filter&gt;
&lt;se:PolygonSymbolizer&gt;
&lt;se:Fill&gt;
&lt;se:SvgParameter name="fill"&gt;#edf8fb&lt;/se:SvgParameter&gt;
&lt;/se:Fill&gt;
&lt;se:Stroke&gt;
&lt;se:SvgParameter name="stroke"&gt;#000000&lt;/se:SvgParameter&gt;
&lt;se:SvgParameter name="stroke-width"&gt;0.26&lt;/se:SvgParameter&gt;
&lt;/se:Stroke&gt;
&lt;/se:PolygonSymbolizer&gt;
&lt;/se:Rule&gt;

and this can be a problem, as I need to hand modify all the SLD I'm producing with QGIS now. Also, the label shown in QGIS is not exported in the SLD as you can see the style do not render any layer label.
QGIS in use is 2.01 on Linux.

Is there a way to solve this?

IMAGE_1.png - QGIS Preview (91.6 KB) stefano nardone, 2014-01-17 03:22 AM

IMAGE_2.png - Geoserver Output Saved SLD (91.6 KB) stefano nardone, 2014-01-17 03:22 AM

IMAGE_2.png - Geoserver Output Saved SLD (CORRECT) (18.4 KB) stefano nardone, 2014-01-17 03:26 AM

History

#1 Updated by stefano nardone over 10 years ago

Please consider this pic as IMAGE 2 - Geoserver Output Saved SLD

#2 Updated by Simon Oberhammer over 8 years ago

I have the same problem when exporting graduated styles to SLD. This issue boils down to this:

The first condition of a filter rule "fooproperty >= 0.000000 AND fooproperty <= 0.570000" is wrongly exported as "ogc:PropertyIsGreaterThan" instead of the correct "ogc:PropertyIsGreaterThanOrEqualTo".

#3 Updated by Giovanni Manghi about 7 years ago

  • Easy fix? set to No
  • Regression? set to No

#4 Updated by Andrea Aime over 6 years ago

  • Status changed from Open to Closed
  • Description updated (diff)
  • Resolution set to fixed/implemented

This has been fixed by Nyall over a year ago: 5c270ebeb0aaaaaf03c24e7d2379c89ebee7b895

in reference to #15212

Also available in: Atom PDF