The support of InlineContent was added to SLDParser and se.v1_1, as a result
of fixing of GEOT-4340. But this support deals only with raster images in
base64 encoding.
Value "xml" of the attribute "encoding" of InlineContent element, declared
in Schema, remained unsupported. This value corresponds to SVG images, as I
understand. 
So we have no ability to insert some short SVG description directly into
SLD.
The new issue GEOT-5206 was created in JIRA to indicate this discrepancy.

I have implemented the support of SVG images in InlineContenet element for
SLDParser in my branch of geotools

https://github.com/igorvolk/geotools/tree/svg_in_inlineContent

Иге I was not able to repeat this success for se.v1_1.
The main problem is as follows.
The single tool, which can help to access batik, is SVGGraphicFactory in
gt-svg module. But this class can't be referenced from SLDParser directly,
because gt-svg depends on gt-main. So we must resolve somewhere this
circular dependency. 
I have declared in gt-api a new interface ExternalGraphicFactory2 with a
single method
 Icon getIcon(byte[] byteContent, String format, int size)
 and I have implemented this interface in SVGGraphicFactory. Because this
interface is declared in gt-api, I can use it everywhere in geotools.
But I need some factory finder, which can deliver me the instance of
SVGGraphicFactory.
In SLDParser I chose to use CommonFactoryFinder. I have added to it the
method 

ExternalGraphicFactory2 getExternalGraphicFactories2(Hints hints). 

I couldn't get CommonFactoryFinder to find SVGGraphicFactory in any
META-INF/services directory. I tried to include file, named
org.geotools.styling.ExternalGraphicFactory2, in META-INF/services
directories of gt-main and gt-svg. The file contained the single string 

org.geotools.renderer.style.SVGGraphicFactory.

But this did not worked. CommonFactoryFinder could not find this factory. I
don't know why. 
So, I pointed to SVGGraphicFactory directly in the hints to
CommonFactoryFinder and everything began to work for SLDParser. But not for
se.v1_1. The test for se.v1_1 in context of gt-xsd-sld module complains that
the code in CommonFactoryFinder

Class.forName("org.geotools.renderer.style.SVGGraphicFactory")

can't find the class. But the same code works well in the context of test
for gt-svg module (which uses SLDParser).
What can you to advice me? 




--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Support-of-SVG-images-in-InlineContent-parameter-of-ExternalGraphic-tp5221760.html
Sent from the geotools-devel mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to