2

I am trying to add multiple symbols to my SLD using the bulk ttf marks. However it does not work, it always returns a blank mapview.

This is part of my code and lets say I would like to add a little diamond:

    <Rule>
      <Title>diamond</Title>
      <ogc:Filter>
        <ogc:PropertyIsEqualTo>
          <ogc:PropertyName>symbool</ogc:PropertyName>
          <ogc:Literal>Diamond</ogc:Literal>
        </ogc:PropertyIsEqualTo>
      </ogc:Filter>
      <PointSymbolizer>
        <Graphic>
          <Mark>
            <WellKnownName>ttf://Arial#0x2666</WellKnownName>
            <Fill>
             <CssParameter name="fill">
               <ogc:Function name="Recode">
                 <ogc:Function name="strTrim">
                   <ogc:PropertyName>kleur</ogc:PropertyName>
                 </ogc:Function>

                 <ogc:Literal>Blue</ogc:Literal>
                 <ogc:Literal>#6495ED</ogc:Literal>

                 <ogc:Literal>Green</ogc:Literal>
                 <ogc:Literal>#B0C4DE</ogc:Literal>

                 <ogc:Literal>Yellow</ogc:Literal>
                 <ogc:Literal>#00FFFF</ogc:Literal>
               </ogc:Function>
             </CssParameter>
           </Fill>
          </Mark>
        </Graphic>
      </PointSymbolizer>
    </Rule>

The data consists of a few points which have two columns to declare how they should be visualized. One is containing a symbol code (Symbool) and another a color code (Kleur). (It is partly in Dutch)

I am only a geography student (so also a beginner and not a real ITer) and we might have limited rights (I'm not 100% sure). I thought maybe I couldn't use the font Arial, but when I did a quick test by adding a label, this does work.

Do I make another mistake?

1

It is hard to answer a question like this without the data source. But here are some things to try:

  1. Does it work when you use "square" or "circle" in the WellKnownName tag? If so there is a font issue - are you on a Linux box? check the available fonts from the About GeoServer menu page.

  2. Does it work if you replace the recode statement with say black? if so then there is an issue with that recode block.

  3. If it still doesn't work with either of those changes then you have a filter problem, either symbool or Diamond are wrong (both are case sensitive).

2
  • Thank you for your answer! The code is perfectly fine with "square or "circle", it uses the correct symbols and colors and the recode statement is working as it should be. I changed the capital from 'Diamond' to a small d and now I can see my map again but it doesn't return a diamond symbol. 'Symbool' should be fine, since it is working for other lines of code. We are not on Linux I think. I updated my question with some information concerning the data. – aforcevi Feb 28 '18 at 14:18
  • Once I installed Arial on my machine it works for me. Have a look in your log file and see if you can see any error messages – Ian Turton Mar 1 '18 at 10:01

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.