1

I have the below part of SLD:

<sld:WellKnownName>ttf://Wingdings#0xE0</sld:WellKnownName>
<sld:Fill>
  <sld:CssParameter name="fill">#0000FF</sld:CssParameter>
  <sld:CssParameter name="fill-opacity">0.5</sld:CssParameter>                                    
</sld:Fill>

But it does not work due to lack of Wingding fonts in host server. I am looking for alternative way of drawing right arrow. I tried below using HTML right arrow entity (→):

<sld:WellKnownName>&#x2192;</sld:WellKnownName>

But geoserver throws exception on that: java.lang.IllegalArgumentException: The specified mark → was not found!

1

Without knowing what fonts you have on your server this is hard to answer, on my linux box I can get a right arrow using:

<sld:WellKnownName>ttf://DejaVu Sans#0x2192</sld:WellKnownName>

I found this by hunting through the fonts I have installed in Character Map (there is a section called arrows, but there are others under Dingbats). You can download DejaVu Sans from github.

enter image description here

1

As an alternative, you can try out the custom WKT shape support:

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
                       xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd"
                       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">

  <NamedLayer>
    <Name>arrow</Name>
    <UserStyle>
      <Title>right arrow style</Title>
      <FeatureTypeStyle>
        <Rule>
          <Title>right arrow</Title>
          <PointSymbolizer>
            <Graphic>
              <Mark>
                <WellKnownName>wkt://MULTILINESTRING((0 0.5, 1 0.5), (0.75 0.25, 1 0.5, 0.75 0.75))</WellKnownName>
                <Stroke>
                  <CssParameter name="stroke">#0000ff</CssParameter>
                  <CssParameter name="stroke-width">1</CssParameter>
                </Stroke>
              </Mark>
              <Size>25</Size>
            </Graphic>
          </PointSymbolizer>
        </Rule>

      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

The result being, roughly:

enter image description here

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.