zoukankan      html  css  js  c++  java
  • geotools解析SLD中的elsefilter为什么里面的filter无效

    原因是在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);

    }
    }
    }

  • 相关阅读:
    Python 集合 深浅copy
    python基础(基础数据类型)
    python基础一
    Asp.net获取网站绝对路径的几种方法
    Ajax请求被缓存的几种处理方式
    说说字符编码
    linux学习记录
    mysql基础
    【Android开发入门】关于ListView中按钮监听器设置的解决方案
    线程同步小结
  • 原文地址:https://www.cnblogs.com/yoyogis/p/4155227.html
Copyright © 2011-2022 走看看