Following my other thread with CSSParameter and SVGParameter and the revelation there's a SVG 1.0 and 1.1, I've discovered this issue is caused because the stylesheet is 1.1.0, and apparently GeoServer can't handle external SVG fills with that version yet.
I converted it to 1.0.0 and it now mostly works, but there's one problem: One of the key elements I was using was "<Displacement>", which allows you to offset a fill by a specified number of pixels, but this doesn't appear to be in 1.0.0. Is there any way around this or is it simply a case of waiting for that aspect of SLD 1.1 to be implemented into GeoServer? Thanks, Jonathan On 7 January 2013 12:17, Jonathan Moules <jonathanmou...@warwickshire.gov.uk > wrote: > Further, > I've now tried: > <se:OnlineResource xlink:type="simple" > xlink:href="D:\Geoserver_data\styles\svgs\boulderGeometry.svg"/> > > Which fails with: > > Parsing failed for href: java.net.URISyntaxException: Illegal character in > opaque part at index 2: D:\Geoserver_data\styles\svgs\boulderGeometry.svg > > ----- > > So I tried with the slashes the other ("wrong") way: > <se:OnlineResource xlink:type="simple" > xlink:href="D:/Geoserver_data/styles/svgs/boulderGeometry.svg"/> > > which fails validation with: > "Parsing failed for ExternalGraphic: java.net.MalformedURLException: > unknown protocol: d" > > ---- > When trying to render the legend on the layers->Publishing page, they both > fail with the same console error. > > > So I think I've tried every single possible combination and GeoServer > fails them all. What am I missing? > Cheers, > Jonathan > > > > On 7 January 2013 11:58, Jonathan Moules < > jonathanmou...@warwickshire.gov.uk> wrote: > >> 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 Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery and much more. Keep your Java skills current with LearnJavaNow - 200+ hours of step-by-step video tutorials by Java experts. SALE $49.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122612
_______________________________________________ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users