@Override public Pair<Double, Double> getTransformedExtrema(LayerConfiguration config) throws ConfigurationException { // Parse the mins and maxes for the buckets out of the supplied JSON. if (_minVals == null) { String layer = config.getPropertyValue(LAYER_ID); _minVals = parseExtremum(config, LEVEL_MINIMUMS, "minimum", layer, 0.0); _maxVals = parseExtremum(config, LEVEL_MAXIMUMS, "maximum", layer, 1000.0); } // Compute the min/max for the range of buckets. double minimumValue = Double.MIN_VALUE; double maximumValue = -Double.MAX_VALUE; for (Integer index: _variables) { Double val = _minVals.get(index); if (val < minimumValue) { minimumValue = val; } val = _maxVals.get(index); if (val > maximumValue) { maximumValue = val; } } return new Pair<>(minimumValue, maximumValue); }
@Override protected TileTransformer<?> create () throws ConfigurationException { String transformerTypes = getPropertyValue(TILE_TRANSFORMER_TYPE); if ("filtervars".equals(transformerTypes)) { JSONObject variables = getPropertyValue(INITIALIZATION_DATA); return new FilterVarsDoubleArrayTileTransformer<>(variables); } else if ("filterbucket".equals(transformerTypes)) { JSONObject arguments = getPropertyValue(INITIALIZATION_DATA); return new FilterByBucketTileTransformer<>(arguments); } else if ("filtertopicbucket".equals(transformerTypes)) { JSONObject arguments = getPropertyValue(INITIALIZATION_DATA); return new FilterTopicByBucketTileTransformer<>(arguments); } else if ("avgdivbucket".equals(transformerTypes)) { JSONObject arguments = getPropertyValue(INITIALIZATION_DATA); return new AvgDivBucketTileTransformer<>(arguments); } else if ("avglogbucket".equals(transformerTypes)) { JSONObject arguments = getPropertyValue(INITIALIZATION_DATA); return new AvgLogBucketTileTransformer<>(arguments); } else { // 'identity' or none passed in will give the default transformer return new IdentityTileTransformer<Object>(); } } }