Bug report #16389

sld stroke color is not saved correctly in polygonsymbolyzer

Added by Gabriele Monfardini over 7 years ago. Updated over 7 years ago.

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

Description

I've saved a style in SLD format.
In the style there were some polygons styled with simple fill and varius stroke colors.
Saving the style as SLD stroke color is saved incorrectly (and always with the same value).

Having a look at the code in git master (a71132a15bb7a5be3ff8fbd73331bcf0d6b0aaa8) in src/core/symbology-ng/qgsfillsymbollayer.cpp +347

QgsSymbolLayerUtils::lineToSld( doc, strokeElem, mStrokeStyle, strokeWidth, strokeWidth, &mPenJoinStyle );

forth parameter that should be a const QColor seems to be wrong (and in fact in our case stroke color resulted to be always 000004 since our strokeWidth is 4).

I think it should be corrected in

QgsSymbolLayerUtils::lineToSld( doc, strokeElem, mStrokeStyle, mStrokeColor, strokeWidth, &mPenJoinStyle );

This fixes the issue in my case.
I'm providing a small patch for this

patch_sld_stroke_color.patch Magnifier - Patch to fix this issue (823 Bytes) Gabriele Monfardini, 2017-03-29 02:29 AM

Associated revisions

Revision cf2f431f
Added by Alessandro Pasotti over 7 years ago

Merge pull request #4334 from gabrimonfa/bug_16389_sld_stroke_color

fixes #16389 stroke color is not correctly exported in SLD

History

#2 Updated by Anonymous over 7 years ago

  • Status changed from Open to Closed

#3 Updated by Jürgen Fischer over 7 years ago

  • Category set to Unknown

Also available in: Atom PDF