Hi everyone,
I'm trying to move from 2.1 to 2.3 and it seems style has changed
significantly. If someone has a snippet of how to do FeatureTypeStyle
with rules and polygon smybolizers I'd really appreciate it. If not
maybe we can start with smaller questions.
Here's some simplified older code that I'm trying to convert.
<code>
StyleBuilder sb = new StyleBuilder();
Expression left = sb.attributeExpression(p_Attribute);
Expression right = sb.literalExpression(literal);
org.opengis.filter.Filter filter = filterFactory.less(left, right);
Stroke stroke = sb.createStroke(new Color(0,245,0), 2);
PolygonSymbolizer symbolizer = sb.createPolygonSymbolizer(stroke,
sb.createFill(new Color(155,102,0)));
Rule rule = sb.createRule(symbolizer);
rule.setFilter((org.geotools.filter.Filter)filter);
FeatureTypeStyle fts = sb.createFeatureTypeStyle(p_FeatureTypeName, rule);
</code>
Two questions:
1) note the cast in the rule.setFilter - org.geotools.filter.Filter is
deprecated but that's what setFilter requires. Am I just missing the
new way of doing things or is this a bug?
2) when using StyleBuilder.attributeExpression it seems the FeatureType
is never specified - how should that be set (ie I'm specifying a column
but not a table).
Thanks,
Oliver
-------------------------------------------------------------------------
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