Hi List,
I have some polygons I want to be filled with a SVG style. The
documentation makes it clear GeoServer supports this:
http://docs.geoserver.org/stable/en/user/styling/sld-reference/pointsymbolizer.html#externalgraphic

However I'm having issues getting it to work.
- I've tried placing the SVG files onto a local web-server and accessing
them like that, but all I get in the legend is grey boxes.
- Then I placed them into /geoserver_data/styles/svgs - this resulted in a
GeoServer console error.
- Then I placed them in the styles directory itself, but I still get the
GeoServer console error.

This page (
http://docs.geoserver.org/stable/en/user/styling/sld-extensions/pointsymbols.html#external-graphics)
makes it clear that my links are correct (well, maybe not the ./svgs/ one,
but it follows convention).



My GeoServer error seems to imply it can't find the files:

07 Jan 11:22:41 ERROR [org.geoserver.ows] -
org.geoserver.platform.ServiceException: java.io.IOException
        at
org.geoserver.wms.legendgraphic.GetLegendGraphicKvpReader.read(GetLegendGraphicKvpReader.java:163)
        at
org.geoserver.wms.legendgraphic.GetLegendGraphicKvpReader.read(GetLegendGraphicKvpReader.java:54)
        at
org.geoserver.ows.Dispatcher.parseRequestKVP(Dispatcher.java:1405)
        ...

And example of the applicable part of my SLD:

          <se:PolygonSymbolizer>
            <se:Fill>
              <se:GraphicFill>
                <se:Graphic>
                  <se:ExternalGraphic>
                    <OnlineResource xlink:type="simple" xlink:href="
http://wppgeog3/geoserver/OSMM_SVG_symbols/boulderGeometry.svg"/>
                    <Format>image/svg+xml</Format>
                  </se:ExternalGraphic>
                  <se:Size>3</se:Size>
                  <se:Displacement>
                    <se:DisplacementX>3</se:DisplacementX>
                    <se:DisplacementY>4</se:DisplacementY>
                  </se:Displacement>
                </se:Graphic>
              </se:GraphicFill>
            </se:Fill>
            <VendorOption name="distance">10,10</VendorOption>
          </se:PolygonSymbolizer>

This one gives me grey boxes in my legend.

----------

Other URL lines include:
                    <OnlineResource xlink:type="simple"
xlink:href="./svgs/boulderGeometry.svg"/>

                    <OnlineResource xlink:type="simple"
xlink:href="/svgs/boulderGeometry.svg"/>

                    <OnlineResource xlink:type="simple"
xlink:href="boulderGeometry.svg"/>

Those three give me the GeoServer error.
They also fail GeoServer validation:
"Parsing failed for ExternalGraphic: java.lang.IllegalArgumentException:
URI is not absolute"

But the documentation example includes a clearly relative URI.

                    <OnlineResource xlink:type="simple"
xlink:href="%GEOSERVER_DATA_DIR%/styles/svgs/rockFillSymbol.svg"/>

Fails validation with:
"Parsing failed for href: java.net.URISyntaxException: Malformed escape
pair at index 0: %GEOSERVER_DATA_DIR%/styles/svgs/boulderGeometry.svg"

----------

TL;DR: How do I make SVG Fill work with an ExternalGraphic?

Thanks,
Jonathan


This transmission is intended for the named addressee(s) only and may contain 
sensitive or protectively marked material up to RESTRICTED and should be 
handled accordingly. Unless you are the named addressee (or authorised to 
receive it for the addressee) you may not copy or use it, or disclose it to 
anyone else. If you have received this transmission in error please notify the 
sender immediately. All email traffic sent to or from us,  including without 
limitation all GCSX traffic, may be subject to recording and/or monitoring in 
accordance with relevant legislation.
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to