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
image/svg+xml
</se:ExternalGraphic>
se:Size3</se:Size>
se:Displacement
se:DisplacementX3</se:DisplacementX>
se:DisplacementY4</se:DisplacementY>
</se:Displacement>
</se:Graphic>
</se:GraphicFill>
</se:Fill>
10,10
</se:PolygonSymbolizer>
This one gives me grey boxes in my legend.
Other URL lines include:
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.
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.