2

I want to create a LineSymbolizer which consists of an SVG (or png) image that is repeated along line. I have used this code but it does not show the image - can someone please gives me some hints?

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
  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"
  xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
  <NamedLayer>
    <Name>tt</Name>
    <UserStyle>
      <Name>tt</Name>
      <Title>tt distribution</Title>
      <FeatureTypeStyle>
      <Rule>
       <LineSymbolizer>
         <Stroke>
           <CssParameter name="stroke">#0000FF</CssParameter>
           <CssParameter name="stroke-width">1</CssParameter>
           <CssParameter name="stroke-dasharray">10 10</CssParameter>
         </Stroke>
       </LineSymbolizer>
       <LineSymbolizer>
         <Stroke>
           <GraphicStroke>
              <Graphic>
                  <ExternalGraphic>
                    <OnlineResource xlink:type="simple" xlink:href="palm_fill.png" />
                    <Format>image/png</Format>
                  </ExternalGraphic>
                  <Opacity>
                    <ogc:Literal>1.0</ogc:Literal>
                  </Opacity>
                </Graphic>
           </GraphicStroke>
           <CssParameter name="stroke-dasharray">5 15</CssParameter>
           <CssParameter name="stroke-dashoffset">20</CssParameter>
         </Stroke>
       </LineSymbolizer>
     </Rule>
   </FeatureTypeStyle>
   </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>
  • What does the log file say? – Ian Turton Jan 1 '15 at 11:52
  • 1
    Are sure that the png-file palm_fill.png is available for users of the service? – ragnvald Jan 2 '15 at 8:50
  • you should write this sld in 2 rules. – user52715 May 27 '15 at 5:21

Your Answer

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

Browse other questions tagged or ask your own question.