Bug report #6155

SLD Export fails to write out LineSymbolizer Stroke information

Added by Jody Garnett about 8 years ago. Updated over 1 year ago.

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

Description

To reproduced using master:
1. natural earth quickstart dataset
2. qgis "new symbology" styles from under dark (thanks!)
3. Using the 10m_rivers_lake_centerlines_scale_ranks layer
4. export to SLD

Resulting Rules generate with empty LineSymbolizers:

                 <sld:Rule>
                    <sld:Name>0.000 - 0.200</sld:Name>
                    <ogc:Filter>
                        <ogc:And>
                            <ogc:PropertyIsGreaterThan>
                                <ogc:PropertyName>StrokeWeig</ogc:PropertyName>
                                <ogc:Literal>0</ogc:Literal>
                            </ogc:PropertyIsGreaterThan>
                            <ogc:PropertyIsLessThanOrEqualTo>
                                <ogc:PropertyName>StrokeWeig</ogc:PropertyName>
                                <ogc:Literal>0.2</ogc:Literal>
                            </ogc:PropertyIsLessThanOrEqualTo>
                        </ogc:And>
                    </ogc:Filter>
                    <sld:LineSymbolizer>
                        <sld:Stroke/>
                    </sld:LineSymbolizer>
                </sld:Rule>

10m_rivers_lake_centerlines_scale_ranks.sld - Converted from under dark new symbology for natural earth (6.38 KB) Jody Garnett, 2012-08-04 07:33 PM

History

#1 Updated by Jody Garnett about 8 years ago

Looks to be just a interoperability fail, SLD 1.0 version SLD 1.1 etc...

For examples of the different files: http://docs.geotools.org/latest/userguide/library/xml/style.html

Options:
- If saving an style.sld file perhaps include version="1.1.0"
- also have the option of saving just the FeatureTypeStyle tag as a distinct "style.se" document.

#2 Updated by Giovanni Manghi about 8 years ago

  • Operating System deleted (Linux)

#3 Updated by Jody Garnett about 8 years ago

Okay I got trapped on the SLD 1.0 vs SE 1.1 divide:

A bit of progress here manually taking things back to an SLD 1.0 file:
- Search and replace "se:" "sld:"
- Switching from "SvgParmeter" to "CssParameter"

Related GeoTools bug report is here: https://jira.codehaus.org/browse/GEOT-4220

#4 Updated by Giuseppe Sucameli about 8 years ago

  • Status changed from Open to Feedback

QGis export styles to SLD 1.1 only, and the version="1.1.0" attribute is present in the root tag.

I doesn't understand how to reproduce the issue, something is missing in the ticket description: QGis cannot create the sld snippet you've written above because QGis doesn't write tags with SLD namespace as it uses SE namespace.

#5 Updated by Giuseppe Sucameli about 8 years ago

Jody Garnett wrote:

Related GeoTools bug report is here: https://jira.codehaus.org/browse/GEOT-4220

Is it a QGis bug or GeoTools one? Or maybe a QGis-GeoTools interoperability issue?

#6 Updated by Jody Garnett about 8 years ago

Evening Giuseppe.

Nathan and myself were at a code sprint this weekend trying a bit of SLD interoperability. I am in the process of updating the issue as I find out more information. I concur that the issues is on the parsing side between SLD version 1.1 and 1.0 differences. I was also a bit surprised that you are saving SLD 1.1 files.

SLD is focused on configuring a WMS server (ie many layers).
The SE part (ie feature type style) can be used in isolation and saved out to a file to capture how to style one layer.

This difference is why the specification was split into two documents. I am going to try and think of a good alternative, for example saving an "se" file.

#7 Updated by Giuseppe Sucameli about 8 years ago

Jody Garnett wrote:

I was also a bit surprised that you are saving SLD 1.1 files.

SLD/SE 1.1 fits more with the new symbology, converting to SLD 1.0 would result in a lot missing features instead.

The SE part (ie feature type style) can be used in isolation and saved out to a file to capture how to style one layer.
I am going to try and think of a good alternative, for example saving an "se" file.

I guess it would be good to put it beside the current behavior, i.e. having another Save style option for storing the SE style part into a .se file with the <se:FeatureTypeStyle> as root element.

#8 Updated by Jody Garnett about 8 years ago

With a bit of help from Andrea Amie I have switch over to the SLD 1.1 parser (as such the differences between SvgParameter and CssParameter are now handled and I am for the most part getting visual results.

I am still finding a couple glitches as I go through the slid of styles; is it okay to keep this bug report open to go through them or would you like me to start another?

1) 10m_admin_0_boundary_breakaway_dispuded_area.sld
Fine

2) 10m_admin_0_boundary_lines_land.sld
Fine. Minor differences. The SvgParameter "stroke" is not written out on this end as the value "#000000" provided is the SLD default (and thus not needed).

3) 10m_admin_0_boundary_lines_maritime_indicator

Fine. Although the GeoTools rendering engine does not do much with a stroke-dasharray of "1 1". Perhaps we have a different take on the spec?

4) 10m_admin_0_breakaway_disputed_areas
Fine.

5) 10m_admin_0_map_subunits
Untested: I don't have an SLD export of this one.

6) 10m_admin_0_map_units
Invalid: Generates a Rule named "Single symbol" that does not have a list of symbolisers. This is invalid according to the spec; I have inserted some defensive coding so uDig no longer errors out.

7) 10m_admin_0_scale_ranks_with_minor_islands
Nice

8) 10m_admin_1_states_provinces_lines_shp
Check

9) 10m_admin_1_states_provinces_shp
Contains two rules (default) and (highlight) where default performs an equals test against an empty literal. This should probably be an <se:lseFilter/> or a <ogc:PropertyIsNull> depending

I will continue to take notes here http://udig.refractions.net/confluence/display/UDIG/1.3.2 and will report back as needed.

#9 Updated by Paolo Cavallini almost 8 years ago

  • Assignee changed from Giuseppe Sucameli to anonymous -

#10 Updated by Jürgen Fischer over 6 years ago

  • Target version changed from Version 2.0.0 to Future Release - Lower Priority

#11 Updated by Jürgen Fischer over 6 years ago

  • Assignee deleted (anonymous -)

#12 Updated by Giovanni Manghi about 6 years ago

  • Status changed from Feedback to Open

#13 Updated by Giovanni Manghi over 3 years ago

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

#14 Updated by Andrea Aime about 3 years ago

  • Description updated (diff)

Hi Jody, do you have a reference to the symbology used in this report?
Do you know if the reported issue is still current, much has changed in both QGIS and GeoTools SE 1.1 support

#15 Updated by Jody Garnett over 2 years ago

Andrea Aime wrote:

Hi Jody, do you have a reference to the symbology used in this report?
Do you know if the reported issue is still current, much has changed in both QGIS and GeoTools SE 1.1 support

Yes, the natural earth dataset is here: http://www.naturalearthdata.com/downloads/

That page has a download link for "Natural Earth quick start kit", this download includes a QGIS project file. As a test I went through and exported the style for each layer, comparing the visual result between QGIS and GeoServer. I was able to match the LnF by hand, and can share the handbill SLD files with you if you like as a reference point.

We may wish to make a new bug report specifically about this as a good interoperability test, and close this issue on LineSymbolizer stroke information.

#16 Updated by Giovanni Manghi over 1 year ago

  • Status changed from Open to Closed
  • Resolution set to end of life

Also available in: Atom PDF