Manuele Ventoruzzo ha scritto:
> Hi all,
> 
> I have found a problem using Mark symbols that have to be evaluated 
> through attribute expressions.
> 
> Suppose that I want to show different symbols in a set of points and 
> that mark well known name is stored in an attribute named "symbol".
> 
> This is resulting java code:
> 
>         Mark theMark = sb.createMark(sb.attributeExpression("symbol"),
>                 sb.createFill(Color.RED, 0.5), null);
>         Graphic graph = sb.createGraphic(null,new Mark[] {theMark},null,
>             
> sb.literalExpression(1),sb.attributeExpression("size"),sb.attributeExpression("rotation"));
>         PointSymbolizer aPointSymbolizer = sb.createPointSymbolizer(graph);
> 
> So, everything works only and only if I use a label that evaluates 
> "symbol" attribute.
> Otherwise, Geotools doesn't keep attribute value in the subset used 
> during map rendering phase.

What happens when you use a mark? Exceptions? You don't see anything?
What renderer are you using?
In StreamingRenderer the expression above is turned into a java2d shape 
by the following code:

Shape shape = 
Java2DMark.getWellKnownMark(mark.getWellKnownName().getValue(feature) 
                                                           .toString());

which should work just fine.

Cheers
Andrea

-------------------------------------------------------------------------
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

Reply via email to