Thanks a lot Andrea,

Just to clarify....From tomrrow evening the 2.1.x Geoserver will have the 
ability to create an inside buffer using the SLD you attatched?

I am using 2.1.2 which is about a month old, and the sld doesn´t buffer the 
polygon, which is the reason i´m asking.

<Rule>
          <PolygonSymbolizer>
            <Fill>
              <CssParameter name="fill">#AAAAAA</CssParameter>  <!-- THIS FILLS 
THE WHOLE POLYGON WITH #AAAAAA-->
            </Fill>
            <Stroke>
              <CssParameter name="stroke">#000000</CssParameter> <!-- THIS 
DEFINES THE OUTLINE STROKE OF THE WHOLE POLYGON -->
              <CssParameter name="stroke-width">1</CssParameter>
            </Stroke>
          </PolygonSymbolizer>
          
          <PolygonSymbolizer>
            <Geometry>
              <ogc:Function name="buffer"> <!-- THIS BUFFERS THE WHOLE POLYGON 
WITH A DISTANCE OF 0.5 UNITS INSIDE-->
                <ogc:PropertyName>the_geom</ogc:PropertyName>
                <ogc:Literal>-0.5</ogc:Literal>
              </ogc:Function>
            </Geometry>
            
            <Stroke>
              <CssParameter name="stroke">#000000</CssParameter> <!-- THIS 
STYLES THE STROKE OF THE BUFFER OUTLINE-->
              <CssParameter name="stroke-width">3</CssParameter>
            </Stroke>
          </PolygonSymbolizer>

        </Rule>

I assume that the Buffer itself can also be a different color than the whole 
polygon fill by adding a fill to the buffer part of the sld.

thanks,

Rob



________________________________
Von: Andrea Aime <[email protected]>
An: Robert Buckley <[email protected]>
Cc: "[email protected]" 
<[email protected]>
Gesendet: 11:15 Dienstag, 1.November 2011 
Betreff: Re: [Geoserver-users] Buffer function in an sld?

On Tue, Nov 1, 2011 at 8:10 AM, Robert Buckley <[email protected]> wrote:
> Hi,
> I have recently read this pdf explaining the amazing capabilities of slds
> and geoserver styling.
> GeoServer Cartographic Rendering
> - http://2010.foss4g.org/presentations/3588.pdf
> Looking at page 27 - Geometry transformationsm, it seems possible to create
> a buffer in a sld file. How does this work?

The geometry transformations mechanism is described in the user guide:
http://docs.geoserver.org/stable/en/user/styling/sld-extensions/geometry-transformations.html

> I have a situation where I am trying to style a polygon with a thin outline
> approx. 1 px and a relatively thick line - approx.10px  which is on the
> inside of the polygon. This is currently not possible with slds because i
> cannot define an offset for the thick line.
> Would I be able to use the sld geometry function to do this for me?

You mean something like in the attached image?
It has been generated using the attached pbuffer.sld

Unfortunately negative buffers were never
tried out before and there was an issue with them:
http://jira.codehaus.org/browse/GEOT-3936

I've just committed a fix, tomorrows nightly build from either trunk
or 2.1.x series
should work:
http://gridlock.opengeo.org/geoserver/

Cheers
Andrea

-- 
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------
------------------------------------------------------------------------------
RSA&reg; Conference 2012
Save &#36;700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to