Uploaded image for project: 'GeoTools'
  1. GEOT-5724

CSS: buffer function generates an issue when using fill and stroke

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 16.0
    • Fix Version/s: 16.4, 17.1
    • Component/s: css
    • Labels:
      None
    • Environment:

      GeoServer Version
      2.10-SNAPSHOT

      GeoTools Version
      16-SNAPSHOT (rev 496a4213f3794ac09dd94634526998cae29b10e4)

      Description

      The following SLD code in xml generates a style as shown in the attached image (SLD_buffer.png)

      <?xml version="1.0" encoding="ISO-8859-1"?>
      <StyledLayerDescriptor version="1.0.0"
      xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"
      xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
            <NamedLayer>
              <Name>Roads and vertices</Name>
              <UserStyle>
                    <FeatureTypeStyle>
                      <Rule>
                            <PolygonSymbolizer>
                              <Geometry>
                                    <ogc:Function name="buffer">
                                      <ogc:PropertyName>the_geom</ogc:PropertyName>
                                      <ogc:Literal>200</ogc:Literal>
                                    </ogc:Function>
                              </Geometry>
                               <Fill>
                                    <CssParameter name="fill">#7F7F7F</CssParameter>
                                    <CssParameter name="fill-opacity">0.3</CssParameter>
                              </Fill>
                            </PolygonSymbolizer>
                            <LineSymbolizer>
                              <Stroke />
                            </LineSymbolizer>
                      </Rule>
                    </FeatureTypeStyle>
              </UserStyle>
            </NamedLayer>
      </StyledLayerDescriptor>
      

      if I use the following CSS code the stroke styling has drawn around the buffer (CSS_buffer.png)

      * {
        	stroke: #000000;
        	fill: #7F7F7F;
        	fill-opacity: 0.3;
        	fill-geometry: [buffer(the_geom, 200)];
      }
      

      I found this workaround to obtain the same result of the SLD code but it uses double geometry and opacity (CSS_w_buffer.png)

      * {
        	stroke: #000000;
        	stroke-opacity: 1.0, 0.0;
        	fill: #7F7F7F;
        	fill-opacity: 0.0, 0.3;
        	fill-geometry: [the_geom], [buffer(the_geom, 200)];
      }
      

        Attachments

        1. CSS_buffer.png
          205 kB
        2. CSS_w_buffer.png
          152 kB
        3. SLD_buffer.png
          155 kB

          Activity

            People

            • Assignee:
              aaime Andrea Aime
              Reporter:
              allyoucanmap Stefano Bovio
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: