0

I'm trying to rotate an arrow based on an attribute but the arrow is off by 90 degrees.

Is there a method for doing a mathematical expression on the attribute within the sld?

I've gone over the docs and this thread but have not had any luck. It so far everything I have found pertains to arrows on lines and not arrows alone

this is how Im currently rotating

 <se:PointSymbolizer>
            <se:Graphic>
              <se:Mark>
                <se:WellKnownName>arrow</se:WellKnownName>
                <se:Fill>
                  <se:SvgParameter name="fill">#236de5</se:SvgParameter>
                </se:Fill>
                <se:Stroke>
                  <se:SvgParameter name="stroke">#000000</se:SvgParameter>
                </se:Stroke>
              </se:Mark>
              <se:Size>30</se:Size>
             <se:Rotation>
                <ogc:PropertyName>heading</ogc:PropertyName>
            </se:Rotation>
            </se:Graphic>
            </se:PointSymbolizer>

After reviewing Using simple Math in SLD file on Geoserver? along with reading the geoserver documentation again it is still unclear on where in the function you choose your operator. In my case I would like to use addition. The above question is for multiplication. I would be multiplying by 90 not adding 90, the documentation doe not have comparative examples of mathematical functions being used. I do not see in the documentation where <ogc:Mul> is described. I can assume that <ogc:Add> would work but where is this supported with documentation.

1

You can try using the following:

<se:Rotation>
    <ogc:Add>
        <ogc:PropertyName>ROTATION</ogc:PropertyName>
        <ogc:Literal>90</ogc:Literal>
    </ogc:Add>
</se:Rotation>

See here for the documentation on math operators: link. I grant that the documentation could do with an example or two.

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.