Using code from GeoTools tutorial to create a style containing
pointsymbolizer and using SLDTransformer to export it as XML:
//code//////////////////////////////////////////////////////////////////////////////////////////////////////////////
Mark testMark = sb.createMark(sb.attributeExpression("name"),
sb.createFill(Color.RED, 0.5), null);
Graphic graph = sb.createGraphic(
null, // An external graphics if needed
new Mark[] { testMark }, // a Mark if not an external graphics
null, // aSymbol
sb.literalExpression(1), // opacity
sb.attributeExpression("size"), //size, in this case
we read the data directly in the feature
sb.attributeExpression("rotation")); //rotation, here
read into the feature
PointSymbolizer aPointSymbolizer = sb.createPointSymbolizer(graph);
// creation of the style
style.addFeatureTypeStyle(sb.createFeatureTypeStyle("testPoint",
new Symbolizer[] { aPointSymbolizer }));
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
My question is in generated XML there is section like
<sld:Fill>
<sld:CssParameter name="fill">
<ogc:Literal>#FF0000</ogc:Literal>
</sld:CssParameter>
<sld:CssParameter name="fill-opacity">
<ogc:Literal>1.0</ogc:Literal>
</sld:CssParameter>
</sld:Fill>
But the tutorial suggests that it should be something like
<Fill>
<!-- CssParameters allowed are fill
(the color) and fill-opacity -->
<CssParameter name="fill">#FF0000</CssParameter>
<CssParameter name="fill-opacity">0.5</CssParameter>
</Fill>
Which one is correct?
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users