protected Rule[] updateRuleTitles( FeatureCountProcessor processor, LegendRequest legend, Rule[] applicableRules) { return processor.preProcessRules(legend, applicableRules); }
/** * Pre-processes the legend request and returns a style whose rules have been altered to contain * a feature count * * @param legend * @return * @throws Exception */ public Rule[] preProcessRules(LegendRequest legend, Rule[] rules) { if (rules == null || rules.length == 0) { return rules; } // is the code running in match first mode? MatchFirstVisitor matchFirstVisitor = new MatchFirstVisitor(); legend.getStyle().accept(matchFirstVisitor); boolean matchFirst = matchFirstVisitor.matchFirst; try { GetMapRequest getMapRequest = parseAssociatedGetMap(legend, rules); Map<Rule, AtomicInteger> counters = renderAndCountFeatures(rules, getMapRequest, matchFirst); Rule[] result = updateRuleTitles(rules, counters); return result; } catch (ServiceException ex) { throw ex; } catch (Exception ex) { throw new ServiceException(ex); } }
request.getLegendOption( GetLegendGraphicRequest.COUNT_MATCHED_KEY, Boolean.class))) { countProcessor = new FeatureCountProcessor(request);
rawKvp.remove("HEIGHT"); String layerName = getLayerName(legend); kvp.put("LAYERS", layerName); rawKvp.put("LAYERS", layerName); Style style = buildStyleFromRules(rules); getMap.setStyles(Arrays.asList(style));
request.getLegendOption( GetLegendGraphicRequest.COUNT_MATCHED_KEY, Boolean.class))) { countProcessor = new FeatureCountProcessor(request);
protected Rule[] updateRuleTitles( FeatureCountProcessor processor, LegendRequest legend, Rule[] applicableRules) { return processor.preProcessRules(legend, applicableRules); }