GeoHashGrid { Number pluckDocCount(Map<String, Object> bucket) { if (!bucket.containsKey(DOC_COUNT_KEY)) { LOGGER.warning("Unable to pluck document count, bucket does not contain required key:" + DOC_COUNT_KEY); throw new IllegalArgumentException(); } return (Number) bucket.get(DOC_COUNT_KEY); } GeoHashGrid(); void initalize(ReferencedEnvelope srcEnvelope, SimpleFeatureCollection features); GridCoverage2D toGridCoverage2D(); void setParams(List<String> params); void setEmptyCellValue(Float value); double getCellWidth(); double getCellHeight(); Envelope getEnvelope(); ReferencedEnvelope getBoundingBox(); float[][] getGrid(); void setScale(RasterScale scale); static final String BUCKET_NAME_KEY; static final String BUCKETS_KEY; static final String DOC_COUNT_KEY; static final String VALUE_KEY; }
@Test public void testPluckDocCount() { Number plucked = this.geohashGrid.pluckDocCount(SIMPLE_BUCKET); assertEquals(DOC_COUNT, plucked); }