0

I am trying to get the spacing or gap between arrows in GeoServer to work. The rendering in QGIS is perfect but in the GeoServer the parameters are not read/taken into account. I tried to get around it using Drawing arrow on line using SLD of GeoServer? and Specifying distance between arrows in line SLD in GeoServer? as well as the cookbook about dash array and graphic stroke. Everything is fine in QGIS but in GeoServer the gap disappears.

This is my code for this particular filter that needs the arrows:

<se:Rule>
  <se:Name></se:Name>
      <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
        <ogc:Or>
          <ogc:PropertyIsLike wildCard="%" escape="\" singleChar="_">
            <ogc:PropertyName>highway</ogc:PropertyName>
            <ogc:Literal>motorway</ogc:Literal>
          </ogc:PropertyIsLike>
          <ogc:And>
            <ogc:PropertyIsLike wildCard="%" escape="\" singleChar="_">
              <ogc:PropertyName>highway</ogc:PropertyName>
              <ogc:Literal>trunk</ogc:Literal>
            </ogc:PropertyIsLike>
            <ogc:PropertyIsLike wildCard="%" escape="\" singleChar="_">
              <ogc:PropertyName>oneway</ogc:PropertyName>
              <ogc:Literal>yes</ogc:Literal>
            </ogc:PropertyIsLike>
          </ogc:And>
        </ogc:Or>
      </ogc:Filter>
      <se:LineSymbolizer>
        <se:Stroke>
          <se:GraphicStroke>
            <se:Graphic>
              <se:Mark>
                <se:WellKnownName>filled_arrowhead</se:WellKnownName>
                <se:Fill>
                  <se:SvgParameter name="fill">#ff7f00</se:SvgParameter>
                </se:Fill>
                <se:Stroke>
                  <se:SvgParameter name="stroke">#000000</se:SvgParameter>
                  <se:SvgParameter name="stroke-width">0.5</se:SvgParameter>
                </se:Stroke>
              </se:Mark>
              <se:Size>14</se:Size>
            </se:Graphic>
            <se:Gap>
              <ogc:Literal>250</ogc:Literal>
            </se:Gap>
          </se:GraphicStroke>
        </se:Stroke>
      </se:LineSymbolizer>
    </se:Rule>

I am wondering if I am missing something between QGIS and my export to SLD, or if Geoserver does not read this for some reasons. I found this on github but as it is from 2016 I was wondering if it's still part of geoserver limitations.

  • can you clarify why this is not a duplicate of gis.stackexchange.com/questions/193445/… – Ian Turton Jun 19 '18 at 9:58
  • As I stated in the intro I found this post you are referencing. I tried to adapt it to my SLD but it does not work. The arrows are there the dasharray as well but the spacing is not read. His SLD is version 1.0 and mine is 1.1. Am not sure if this makes a huge difference for geoserver or not. In the github thread I found, they also talk about some parameters for the Marker placement; Offset along line etc. are not saved in SLD. I was wondering if it was still accurate. If not I would like to know what is wrong between what I see in my QGIS desktop and the SLD I export and read in geoserver. – mel Jun 19 '18 at 10:11
  • I would just use dash array and dash offset, I have no idea if GeoServer supports those SE changes, you could check the code. – Ian Turton Jun 19 '18 at 10:39
3

The rendering machinery in GeoServer still ignores the gap property, indeed. Pull requests welcomed :-)

See here (the rendering engine is in GeoTools):
https://github.com/geotools/geotools/blob/master/CONTRIBUTING.md

If you want to contribute money instead of time/skill, see here:
http://geoserver.org/support/

  • Ok thank you for your answer. I am not a developer so my contribution would be useless to the group. However thank you for the links, I will share this in our weekly meeting. Maybe my boss would agree to contribute a bit of money. – mel Jun 19 '18 at 12:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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