Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Reloading SLD file in QGIS #50152

Closed
Miemieku opened this issue Sep 9, 2022 · 0 comments · Fixed by #50266
Closed

Problem with Reloading SLD file in QGIS #50152

Miemieku opened this issue Sep 9, 2022 · 0 comments · Fixed by #50266
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Symbology Related to vector layer symbology or renderers

Comments

@Miemieku
Copy link

Miemieku commented Sep 9, 2022

I have some svg files that I want to use in QGIS and save as SLD files. I added the path of the SVG file to QGIS (Settings -> Option -> System -> SVG Paths), loaded the SVG file on the layer, and exported the SLD file.

But I found that there is a problem with the exported SLD file, when I reloading this SLD file to other layers in QGIS, it will become a question mark. I think the problem is because of this part :
<se:OnlineResource xlink:type="simple" xlink:href="C:/Users/heji/Desktop/Fachdaten/SLD_Fachdaten/svg/Schulform_Sekundarschule.svg?fill=%23232323&fill-opacity=1&outline=%23232323&outline-opacity=1&outline-width=1"/>

When I change it to <se:OnlineResource xlink:type="simple" xlink:href="C:/Users/heji/Desktop/Fachdaten/SLD_Fachdaten/svg/Schulform_Sekundarschule.svg"/>
, it can displays fine.

Does anyone have the same issue as me?

<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:se="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd">
  <NamedLayer>
    <se:Name>Kindergarten Kopie</se:Name>
    <UserStyle>
      <se:Name>Kindergarten Kopie</se:Name>
      <se:FeatureTypeStyle>
        <se:Rule>
          <se:Name>Single symbol</se:Name>
          <se:PointSymbolizer>
            <se:Graphic>
              <!--Parametric SVG-->
              <se:ExternalGraphic>
                <se:OnlineResource xlink:type="simple" xlink:href="C:/Users/heji/Desktop/Fachdaten/SLD_Fachdaten/svg/Schulform_Sekundarschule.svg?fill=%23232323&amp;fill-opacity=1&amp;outline=%23232323&amp;outline-opacity=1&amp;outline-width=1"/>
                <se:Format>image/svg+xml</se:Format>
              </se:ExternalGraphic>
              <!--Plain SVG fallback, no parameters-->
              <se:ExternalGraphic>
                <se:OnlineResource xlink:type="simple" xlink:href="Schulform_Sekundarschule.svg"/>
                <se:Format>image/svg+xml</se:Format>
              </se:ExternalGraphic>
              <!--Well known marker fallback-->
              <se:Mark>
                <se:WellKnownName>square</se:WellKnownName>
                <se:Fill>
                  <se:SvgParameter name="fill">#232323</se:SvgParameter>
                </se:Fill>
                <se:Stroke>
                  <se:SvgParameter name="stroke">#232323</se:SvgParameter>
                  <se:SvgParameter name="stroke-width">1</se:SvgParameter>
                </se:Stroke>
              </se:Mark>
              <se:Size>14</se:Size>
            </se:Graphic>
          </se:PointSymbolizer>
        </se:Rule>
      </se:FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

Versions

QGIS version: 3.16.14-Hannover
Compiled against Qt: 5.15.2

@Miemieku Miemieku added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Sep 9, 2022
@elpaso elpaso self-assigned this Sep 20, 2022
@elpaso elpaso added the Symbology Related to vector layer symbology or renderers label Sep 20, 2022
elpaso added a commit to elpaso/QGIS that referenced this issue Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Symbology Related to vector layer symbology or renderers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants