Hi

I have taken this further - I find that on line 65 of ImageGraphicFactory,
this happens

        if (!supportedGraphicFormats.contains(format.toLowerCase()))
            return null;

And my format (image/svg or image/svg+xml) isn't in the list. So that's
obvious now. The samples (for example, here
http://docs.geotools.org/latest/userguide/library/render/svg.html) show SVG
as being supported.

Questions
1. It should end up in the SVGGraphicFactory implementation of
ExternalGraphicFactory but it doesn't. Any ideas why ? I have gt-svg.jar in
my path. Is it something to do with the StyleFactory and the hints you pass
to it ?

2. In ImageGraphicFactory - at the line shown - perhaps add a meaningful
log message. The original error I repeated is not relevant, it says
something about a null value but this reflects the fact that the method
returned null when maybe it could have thrown a checked exception.


Thanks

Chris




On 14 March 2013 14:02, Chris Faulkner <[email protected]> wrote:

> Hi
>
> Using "StyleLab" from the demo and some point data in a shape file, I
>  successfully displayed points on a map and can see how to alter the style
> and it is helping me to understand the opengis spec on style.
>
> I altered StyleLab so that it displayed the points symbolised with a PNG
> defined in an SLD (attached as ne_10m_ports_png.sld). This works fine and I
> guess this is the important bit.
>
> <ExternalGraphic>
>   <OnlineResource xlink:type="simple" xlink:href="ports.png" />
>   <Format>image/png</Format>
> </ExternalGraphic>
>
> So I replaced that section with this
>
> <ExternalGraphic>
>   <OnlineResource xlink:type="simple" xlink:href="ports.svg" />
>    <Format>image/svg</Format>
> </ExternalGraphic>
>
> and I get this error
>
> Mar 14, 2013 1:46:02 PM org.geotools.renderer.lite.StyledShapePainter paint
> SEVERE: ShapePainter has been asked to paint a null style!!
>
> Any ideas ? ports.svg is in the same folder as the SLD. I get the same
> error  if there is no SVG file there. Yet if I debug the startup , I can
> see the SLD is found and that it creates a Style object.
>
> The "ports.svg" is a valid SVG file in the sense that Chrome and IE will
> display it with no issues.
>
> Thanks
>
>
> Chris
>
>
>
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to