org.geotools.styling.Rule.isElseFilter()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(170)

本文整理了Java中org.geotools.styling.Rule.isElseFilter方法的一些代码示例,展示了Rule.isElseFilter的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rule.isElseFilter方法的具体详情如下:
包路径:org.geotools.styling.Rule
类名称:Rule
方法名:isElseFilter

Rule.isElseFilter介绍

暂无

代码示例

代码示例来源:origin: geotools/geotools

if (r.isElseFilter()) {
  elseRuleList.add(r);
} else {

代码示例来源:origin: geotools/geotools

public RuleBuilder reset(Rule rule) {
  if (rule == null) {
    return unset();
  }
  name = rule.getName();
  title = rule.getTitle();
  ruleAbstract = rule.getAbstract();
  minScaleDenominator = rule.getMinScaleDenominator();
  maxScaleDenominator = rule.getMaxScaleDenominator();
  filter = rule.getFilter();
  elseFilter = rule.isElseFilter();
  symbolizers.clear();
  symbolizers.addAll(rule.symbolizers()); // TODO: unpack into builders in order to "copy"
  symbolizerBuilder = null;
  unset = false;
  legend.reset(rule.getLegend());
  return this;
}

代码示例来源:origin: geotools/geotools

copy.setName(rule.getName());
copy.setFilter(filterCopy);
copy.setElseFilter(rule.isElseFilter());
copy.setMaxScaleDenominator(rule.getMaxScaleDenominator());
copy.setMinScaleDenominator(rule.getMinScaleDenominator());

代码示例来源:origin: org.geoserver/kml

@Override
public void visit(FeatureTypeStyle fts) {
  for(Rule rule : fts.rules()) {
    if(rule.isElseFilter()) {
      filters.add(Filter.INCLUDE);
    } else {
      Filter filter = rule.getFilter();
      if(filter == null) {
        filters.add(Filter.INCLUDE);
      } else {
        filters.add(filter);
      }
    }
  }
}

代码示例来源:origin: org.geoserver.community/gs-vectortiles

private static List<Rule>[] splitRules(final FeatureTypeStyle fts, final double scaleDenominator) {
  List<Rule> ruleList = new ArrayList<Rule>();
  List<Rule> elseRuleList = new ArrayList<Rule>();
  ruleList = new ArrayList<>();
  elseRuleList = new ArrayList<>();
  for (Rule r : fts.rules()) {
    if (isWithInScale(r, scaleDenominator)) {
      if (r.isElseFilter()) {
        elseRuleList.add(r);
      } else {
        ruleList.add(r);
      }
    }
  }
  @SuppressWarnings("unchecked")
  List<Rule>[] ret = new List[] { ruleList, elseRuleList };
  return ret;
}

代码示例来源:origin: org.geoserver.extension/gs-vectortiles

private static List<Rule>[] splitRules(
    final FeatureTypeStyle fts, final double scaleDenominator) {
  List<Rule> ruleList = new ArrayList<Rule>();
  List<Rule> elseRuleList = new ArrayList<Rule>();
  ruleList = new ArrayList<>();
  elseRuleList = new ArrayList<>();
  for (Rule r : fts.rules()) {
    if (isWithInScale(r, scaleDenominator)) {
      if (r.isElseFilter()) {
        elseRuleList.add(r);
      } else {
        ruleList.add(r);
      }
    }
  }
  @SuppressWarnings("unchecked")
  List<Rule>[] ret = new List[] {ruleList, elseRuleList};
  return ret;
}

代码示例来源:origin: org.geotools/gt-render

private List[] splitRules(FeatureTypeStyle fts) {
  Rule[] rules;
  List<Rule> ruleList = new ArrayList<Rule>();
  List<Rule> elseRuleList = new ArrayList<Rule>();
  rules = fts.getRules();
  ruleList = new ArrayList();
  elseRuleList = new ArrayList();
  for (int j = 0; j < rules.length; j++) {
    // getting rule
    Rule r = rules[j];
    if (isWithInScale(r)) {
      if (r.isElseFilter()) {
        elseRuleList.add(r);
      } else {
        ruleList.add(r);
      }
    }
  }
  return new List[] {ruleList, elseRuleList};
}

代码示例来源:origin: geotools/geotools

String.format("${%s}", escapeForEmbededCQL(ECQL.toCQL(rule.getFilter()))));
if (rule.isElseFilter()) {
  put("else", true);

代码示例来源:origin: org.geoserver/kml

static List<List<MiniRule>> minify(Style style) {
  List<List<MiniRule>> ftStyles = new ArrayList<List<MiniRule>>();
  for (FeatureTypeStyle ftStyle : style.featureTypeStyles()) {
    List<MiniRule> rules = new ArrayList<MiniRule>();
    for (Rule rule : ftStyle.rules()) {
      List<PointSymbolizer> pointSymbolizers = new ArrayList<PointSymbolizer>();
      for (Symbolizer symbolizer : rule.symbolizers()) {
        if (symbolizer instanceof PointSymbolizer) {
          pointSymbolizers.add((PointSymbolizer) symbolizer);
        }
      }
      if (!pointSymbolizers.isEmpty())
        rules.add(new MiniRule(rule.getFilter(), rule.isElseFilter(), pointSymbolizers));
    }
    if (!rules.isEmpty()) {
      ftStyles.add(rules);
    }
  }
  return ftStyles;
}

代码示例来源:origin: org.geoserver/gs-wms

protected org.geoserver.wms.GetMapOutputFormat getDelegate(String outputFormat)
      throws ServiceException {
    return new FeatureRenderSpyFormat(
        wms,
        f -> {
          boolean matched = false;
          for (Rule rule : rules) {
            if (rule.isElseFilter()) {
              if (!matched) {
                AtomicInteger counter = counters.get(rule);
                counter.incrementAndGet();
              }
            } else if (rule.getFilter() == null
                || rule.getFilter().evaluate(f)) {
              AtomicInteger counter = counters.get(rule);
              counter.incrementAndGet();
              matched = true;
              if (matchFirst) {
                break;
              }
            }
          }
        });
  };
};

代码示例来源:origin: org.geoserver/kml

@Override
public void visit(Rule rule) {
  if (rule.isElseFilter()) {
    elseSymbolizers.addAll(rule.symbolizers());
  } else if (rule.getFilter() == null || rule.getFilter().evaluate(sf)) {
    symbolizers.addAll(rule.symbolizers());
  }
}

代码示例来源:origin: org.geoserver/gs-wms

private Filter buildRulesFilter(org.opengis.filter.FilterFactory ff, List<Rule> rules) {
  // build up a or of all the rule filters
  List<Filter> filters = new ArrayList<Filter>();
  for (Rule rule : rules) {
    if (rule.getFilter() == null || rule.isElseFilter()) return Filter.INCLUDE;
    filters.add(rule.getFilter());
  }
  // not or and and simplify (if there is any include/exclude we'll get
  // a very simple result ;-)
  Filter or = ff.or(filters);
  SimplifyingFilterVisitor simplifier = new SimplifyingFilterVisitor();
  return (Filter) or.accept(simplifier, null);
}

代码示例来源:origin: geotools/geotools

if (rule.isElseFilter()) {
  start("ElseFilter");
  end("ElseFilter");

代码示例来源:origin: org.geotools/gt-render

if (r.isElseFilter()) {
  elseRuleList.add(r);
} else {

代码示例来源:origin: bcdev/beam

List<Rule> elseRuleList = new ArrayList<Rule>();
for (Rule rule : fts.rules()) {
  if (rule.isElseFilter()) {
    elseRuleList.add(rule);
  } else {

代码示例来源:origin: org.geoserver/gs-wms

rule.getName(),
filterCopy,
rule.isElseFilter(),
rule.getMaxScaleDenominator(),
rule.getMinScaleDenominator());

代码示例来源:origin: robward-scisys/sldeditor

Filter filterCopy = null;
copy.setFilter(filterCopy);
copy.setElseFilter(rule.isElseFilter());

代码示例来源:origin: org.geotools/gt-main

copy.setName(rule.getName());
copy.setFilter(filterCopy);
copy.setElseFilter(rule.isElseFilter());
copy.setMaxScaleDenominator(rule.getMaxScaleDenominator());
copy.setMinScaleDenominator(rule.getMinScaleDenominator());

代码示例来源:origin: org.geotools/gt-ysld

@Override
protected void encode(Rule rule) {
  put("name", rule.getName());
  put("title", rule.getTitle());
  put("abstract", rule.getAbstract());
  if (rule.getFilter() != null && rule.getFilter() != Filter.INCLUDE) {
    put(
        "filter",
        String.format("${%s}", escapeForEmbededCQL(ECQL.toCQL(rule.getFilter()))));
  }
  if (rule.isElseFilter()) {
    put("else", true);
  }
  Tuple t =
      Tuple.of(
          toStringOrNull(rule.getMinScaleDenominator(), "min"),
          toStringOrNull(rule.getMaxScaleDenominator(), "max"));
  if (!t.isNull()) {
    put("scale", t);
  }
  // legend:?
  put("symbolizers", new SymbolizersEncoder(rule));
}

代码示例来源:origin: org.geotools/gt-main

if (rule.isElseFilter()) {
  start("ElseFilter");
  end("ElseFilter");

相关文章