GeoServer SLD – Implementing a Rotated Point Symbolizer Along a Line in GeoServer Using SLD

geoserversld

Geoserver 2.1.3

I would like to symbolize a line with a Square but use the <Rotation>45</Rotation> tags to make the symbol look like a diamond.

My sld is below and unfortunately the symbols are not rotated…Is this not possible or is my SLD wrong?

thanks,

Rob

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld 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>line-symbol rotation</Name>
    <UserStyle>
      <Title>line-symbol rotation</Title>      
      <FeatureTypeStyle>        
        <Rule>      
          <Name>line-symbol rotation</Name>                          
          <LineSymbolizer >    
            <Stroke>
              <GraphicStroke>
                <Graphic>
           <Mark>
             <WellKnownName>square</WellKnownName>
             <Fill>
               <CssParameter name="fill">#009900</CssParameter>
             </Fill>
           </Mark>
           <Size>12</Size>
           <Rotation>45</Rotation>
         </Graphic>           
              </GraphicStroke>              
            </Stroke>
          </LineSymbolizer>                 
        </Rule>        
      </FeatureTypeStyle>         
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

Best Answer

I'm not sure the linestroke will support rotation but why not take the diamond from wingdings:

<Graphic>
          <Mark>
            <WellKnownName>ttf://Wingdings#117</WellKnownName>
            <Fill>
              <CssParameter
                name="fill">#000000</CssParameter>
            </Fill>
          </Mark>
          <Opacity>1</Opacity>
          <Size>18</Size>
        </Graphic>

Did you see this presentation: http://demo.geo-solutions.it/share/foss4g2011/gs_styling_aaime_foss4g2011.pdf

Related Question