TransWikia.com

ExternalGraphic with LineSymbolizer

Geographic Information Systems Asked by Mélanie on May 13, 2021

I want to symbolize a line with a svg symbol.

The following code allows me to get a first result but I would like the symbols to be closer.

How can I set up this ?

          <LineSymbolizer>
            <Stroke>
              <GraphicStroke>
                <Graphic>
                  <ExternalGraphic>
                    <OnlineResource xlink:type="simple" xlink:href="pipsol.svg"/>
                    <Format>image/svg</Format>
                  </ExternalGraphic>
                  <Size> 350 </Size>
                </Graphic>
              </GraphicStroke>
            </Stroke>
          </LineSymbolizer>

Here is pipsol.svg :

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="21.42523"
   height="7.0277019"
   viewBox="0 0 5.6687591 1.8594127"
   version="1.1"
   id="svg8"
   inkscape:version="0.91 r13725"
   sodipodi:docname="pipsol.svg">
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="22.627418"
     inkscape:cx="39.479288"
     inkscape:cy="5.3041206"
     inkscape:document-units="mm"
     inkscape:current-layer="layer1"
     showgrid="true"
     fit-margin-top="1"
     fit-margin-left="1"
     fit-margin-right="1"
     fit-margin-bottom="1"
     units="px"
     inkscape:window-width="2560"
     inkscape:window-height="1377"
     inkscape:window-x="-8"
     inkscape:window-y="-8"
     inkscape:window-maximized="1">
    <sodipodi:guide
       id="guide350"
       position="7.4826825,-50.028373"
       orientation="1,0"
       inkscape:locked="false" />
    <sodipodi:guide
       id="guide352"
       position="-18.975652,2.8882933"
       orientation="0,1"
       inkscape:locked="false" />
    <inkscape:grid
       type="xygrid"
       id="grid4196" />
  </sodipodi:namedview>
  <defs
     id="defs2" />
  <metadata
     id="metadata5">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     transform="translate(-70.223317,-104.5718)"
     id="layer1"
     inkscape:groupmode="layer"
     inkscape:label="Calque 1">
    <g
       id="g107"
       transform="matrix(0.26422092,0,0,0.25578495,58.412536,97.737513)">
      <g
         inkscape:label="Calque 1"
         id="layer1-8"
         transform="translate(-72.445977,-88.41006)">
        <g
           transform="translate(90.098513,-33.584874)"
           id="g949">
          <g
             inkscape:label="Calque 1"
             id="layer1-6"
             transform="translate(-89.897093,33.690368)">
            <g
               transform="translate(10.842793,-36.169005)"
               id="g858">
              <g
                 inkscape:label="Calque 1"
                 id="layer1-07"
                 transform="translate(-10.938001,36.004736)">
                <g
                   id="g784"
                   transform="translate(5.7796696,-40.33357)">
                  <g
                     transform="translate(-3.1304918,40.367138)"
                     id="layer1-5"
                     inkscape:label="Calque 1">
                    <g
                       transform="translate(3.0227785,-38.420563)"
                       id="g740">
                      <g
                         transform="translate(127.632,94.601618)"
                         id="g4353">
                        <rect
                           style="opacity:1;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
                           id="rect4169"
                           width="14.436189"
                           height="2.0319388"
                           x="-15.262414"
                           y="61.59185"
                           ry="0" />
                        <ellipse
                           style="opacity:1;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
                           id="path4183"
                           cx="1.5381269"
                           cy="62.607822"
                           rx="2.6513238"
                           ry="2.6003165" />
                      </g>
                    </g>
                  </g>
                </g>
              </g>
            </g>
          </g>
        </g>
      </g>
    </g>
  </g>
</svg>

result

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP