码迷,mamicode.com
首页 > 其他好文 > 详细

geotools解析SLD中的elsefilter为什么里面的filter无效

时间:2014-12-10 14:11:02      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:des   style   io   ar   sp   for   on   bs   ef   

原因是在org.geotools.renderer.lite.StreamingRenderer中的process函数:

 

/**
* @param rf
* @param feature
* @param fts
* @param layerId
*/
private void process(RenderableFeature rf, LiteFeatureTypeStyle fts,
NumberRange scaleRange, AffineTransform at,
CoordinateReferenceSystem destinationCrs, String layerId)
throws Exception {
boolean doElse = true;
Rule[] elseRuleList = fts.elseRules;
Rule[] ruleList = fts.ruleList;
Rule r;
Filter filter;
Graphics2D graphics = fts.graphics;
// applicable rules
final int length = ruleList.length;
for (int t = 0; t < length; t++) {
r = ruleList[t];
filter = r.getFilter();

if (filter == null || filter.evaluate(rf.content)) {
doElse = false;
processSymbolizers(graphics, rf, r.symbolizers(), scaleRange, at, destinationCrs, layerId);
}
}

if (doElse) {
final int elseLength = elseRuleList.length;
for (int tt = 0; tt < elseLength; tt++) {
r = elseRuleList[tt];

//这里应该像上面一样再通过filter过滤一下:filter = r.getFilter();  if (filter == null || filter.evaluate(rf.content)) {}

processSymbolizers(graphics, rf, r.symbolizers(), scaleRange,
at, destinationCrs, layerId);

}
}
}

geotools解析SLD中的elsefilter为什么里面的filter无效

标签:des   style   io   ar   sp   for   on   bs   ef   

原文地址:http://www.cnblogs.com/yoyogis/p/4155227.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!