I have a PostGIS table with polygon geometries.

I would like to create an sld which first does an inside buffer, and then a difference between the buffer and the original geometry.

This is basically like cutting a hole out of the polygon....ie first buffer (say...50 meters) and then cut this buffered polygon out of the original polygon.

I can´t seem to get my head around the syntax of using the sld filter explained here


<gml:coordinates>1 1</gml:coordinates>

This is an intersect function which only displays the points which intersect 1,1. I guess a DIFFERENCE function with a buffer would have to be somehow nested...but I don´t know if this is possible.

A donut is exactly what I am after. I have to create a symbol for a polygon geometry. This sumbol is made up of a thin outline and a thick band which is inside the polygon (150m width). I have tried to create this using sld but without success. I really don´t want to have to create new geometries in order to symbolize one polygon theme which is why i´m asking if this is possible using just an sld file and one postgis table.

You can take a look at the screenshot here:


This was achieved using a buffered polygon and not using an SLD filter function.


1 Answer 1


Try this,

        <ogc:Function name="difference">    
          <ogc:Function name="buffer">
          <CssParameter name="fill">#894465</CssParameter>
          <CssParameter name="fill-opacity">0.5</CssParameter>  

It works in geoserver 2.7-SNAPSHOT (rev 38562)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.