Uploaded image for project: 'GeoServer'
  1. GEOS-8187

Legend Preview not correctly interpreting SvgParameter

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.11.4, 2.12.1
    • Component/s: None
    • Labels:
      None

      Description

      With SLDs similar to this

      <se:LineSymbolizer>
      <se:Stroke>
      <se:SvgParameter name="stroke">#f6fd16</se:SvgParameter>
      <se:SvgParameter name="stroke-width">4</se:SvgParameter>
      <se:SvgParameter name="stroke-linejoin">bevel</se:SvgParameter>
      <se:SvgParameter name="stroke-linecap">square</se:SvgParameter>
      <se:SvgParameter name="stroke-dasharray">4 2</se:SvgParameter>
      </se:Stroke>
      </se:LineSymbolizer>

      Legend Preview seems to ignore the parameters. The issue is easily replicable. Just replace SvgParameter with CssParameter and the Legend Preview prints a correct legend.

      Full SLD:

      <?xml version="1.0" encoding="UTF-8"?>
      <StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns:se="http://www.opengis.net/se">
        <NamedLayer>
          <se:Name>isoseiste</se:Name>
          <UserStyle>
            <se:Name>isoseiste</se:Name>
            <se:FeatureTypeStyle>
              <se:Rule>
                <se:Name>3.75</se:Name>
                <se:Description>
                  <se:Title>3.75</se:Title>
                </se:Description>
                <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
                  <ogc:PropertyIsEqualTo>
                    <ogc:PropertyName>IPE</ogc:PropertyName>
                    <ogc:Literal>3.75</ogc:Literal>
                  </ogc:PropertyIsEqualTo>
                </ogc:Filter>
                <se:LineSymbolizer>
                  <se:Stroke>
                    <se:SvgParameter name="stroke">#10a529</se:SvgParameter>
                    <se:SvgParameter name="stroke-width">4</se:SvgParameter>
                    <se:SvgParameter name="stroke-linejoin">bevel</se:SvgParameter>
                    <se:SvgParameter name="stroke-linecap">square</se:SvgParameter>
                    <se:SvgParameter name="stroke-dasharray">4 8</se:SvgParameter>
                  </se:Stroke>
                </se:LineSymbolizer>
              </se:Rule>
              <se:Rule>
                <se:Name>4.75</se:Name>
                <se:Description>
                  <se:Title>4.75</se:Title>
                </se:Description>
                <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
                  <ogc:PropertyIsEqualTo>
                    <ogc:PropertyName>IPE</ogc:PropertyName>
                    <ogc:Literal>4.75</ogc:Literal>
                  </ogc:PropertyIsEqualTo>
                </ogc:Filter>
                <se:LineSymbolizer>
                  <se:Stroke>
                    <se:SvgParameter name="stroke">#f6fd16</se:SvgParameter>
                    <se:SvgParameter name="stroke-width">4</se:SvgParameter>
                    <se:SvgParameter name="stroke-linejoin">bevel</se:SvgParameter>
                    <se:SvgParameter name="stroke-linecap">square</se:SvgParameter>
                    <se:SvgParameter name="stroke-dasharray">4 8</se:SvgParameter>
                  </se:Stroke>
                </se:LineSymbolizer>
              </se:Rule>
              <se:Rule>
                <se:Name>5.75</se:Name>
                <se:Description>
                  <se:Title>5.75</se:Title>
                </se:Description>
                <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
                  <ogc:PropertyIsEqualTo>
                    <ogc:PropertyName>IPE</ogc:PropertyName>
                    <ogc:Literal>5.75</ogc:Literal>
                  </ogc:PropertyIsEqualTo>
                </ogc:Filter>
                <se:LineSymbolizer>
                  <se:Stroke>
                    <se:SvgParameter name="stroke">#ff8a4b</se:SvgParameter>
                    <se:SvgParameter name="stroke-width">4</se:SvgParameter>
                    <se:SvgParameter name="stroke-linejoin">bevel</se:SvgParameter>
                    <se:SvgParameter name="stroke-linecap">square</se:SvgParameter>
                    <se:SvgParameter name="stroke-dasharray">4 8</se:SvgParameter>
                  </se:Stroke>
                </se:LineSymbolizer>
              </se:Rule>
              <se:Rule>
                <se:Name>6.75</se:Name>
                <se:Description>
                  <se:Title>6.75</se:Title>
                </se:Description>
                <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
                  <ogc:PropertyIsEqualTo>
                    <ogc:PropertyName>IPE</ogc:PropertyName>
                    <ogc:Literal>6.75</ogc:Literal>
                  </ogc:PropertyIsEqualTo>
                </ogc:Filter>
                <se:LineSymbolizer>
                  <se:Stroke>
                    <se:SvgParameter name="stroke">#d93b26</se:SvgParameter>
                    <se:SvgParameter name="stroke-width">4</se:SvgParameter>
                    <se:SvgParameter name="stroke-linejoin">bevel</se:SvgParameter>
                    <se:SvgParameter name="stroke-linecap">square</se:SvgParameter>
                    <se:SvgParameter name="stroke-dasharray">4 8</se:SvgParameter>
                  </se:Stroke>
                </se:LineSymbolizer>
              </se:Rule>
            </se:FeatureTypeStyle>
          </UserStyle>
        </NamedLayer>
      </StyledLayerDescriptor>
      

        Attachments

          Activity

            People

            • Assignee:
              aaime Andrea Aime
              Reporter:
              afabiani Alessio Fabiani
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: