I'm using Geoserver 2.6.2. I need to represent direction arrows for line features. I have managed to position such marks on lines centroid but I need to position these arrows on the side of the lines. The perpendicularOffset option used for line labels would be the solution I'm looking for but it is restricted to labels styling. How would you code your SLD in order to achieve that?

Below is the code I'm using so far to position arrows on lines:

          <CssParameter name="stroke">#000000</CssParameter>
          <CssParameter name="stroke-width">1</CssParameter>
          <ogc:Function name="centroid">
              <CssParameter name="fill-opacity">0</CssParameter>
              <CssParameter name="stroke-width">1</CssParameter>
            <ogc:Function name="endAngle">

1 Answer 1


As far as I know there isn't an existing function to do that, it might be possible to use the offset function to move an arrow but you'd need to know which direction to go in.

GeoServer does have startPoint and startAngle (and matching end...) functions to allow you to put arrows at the beginning and end of lines.

If You must label the centre of the line then you will need to write a new function (based on endAngle and offset) and add it to your GeoServer.

  • Thank you @iant. I wanted to make sure I wasn't missing an existing function... Writing my own function would be too difficult for me.
    – wiltomap
    Jan 18, 2016 at 9:18

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.