@Test public void testBinSimpleFeature() { SimpleFeature feature1 = createSimpleFeature(new Coordinate(0, 0)); SimpleFeature feature2 = createSimpleFeature(new Coordinate(40, 40)); SimpleFeature feature3 = createSimpleFeature(new Coordinate(40, 40)); GeohashBinningStrategy<SimpleFeature> strat = new GeohashSimpleFeatureBinningStrategy(4); String bin1 = strat.binEntry(feature1)[0]; String bin2 = strat.binEntry(feature2)[0]; String bin3 = strat.binEntry(feature3)[0]; assertThat(bin1, is(not(bin2))); assertThat(bin2, is(bin3)); strat = new GeohashSimpleFeatureBinningStrategy(1); feature1 = createSimpleFeature(new Coordinate(0, 0)); feature2 = createSimpleFeature(new Coordinate(0.01, 0.01)); bin1 = strat.binEntry(feature1)[0]; bin2 = strat.binEntry(feature2)[0]; assertThat(bin1, is(bin2)); }
@Override public String[] binEntry(T entry) { Geometry geometry = this.getGeometry(entry); return geometry == null ? null : new String[] {encodeToGeohash(geometry, this.precision)}; }
GeohashBinningStrategy implements AggregationBinningStrategy<T> { @Override public String[] binEntry(T entry) { Geometry geometry = this.getGeometry(entry); return geometry == null ? null : new String[] {encodeToGeohash(geometry, this.precision)}; } }
GeohashBinningStrategy implements AggregationBinningStrategy<T> { @Override public String[] binEntry(T entry) { Geometry geometry = this.getGeometry(entry); return geometry == null ? null : new String[] {encodeToGeohash(geometry, this.precision)}; } GeohashBinningStrategy(int precision); }
GeohashBinningStrategy implements AggregationBinningStrategy<T> { @Override public String[] binEntry(T entry) { Geometry geometry = this.getGeometry(entry); return geometry == null ? null : new String[] {encodeToGeohash(geometry, this.precision)}; } GeohashBinningStrategy(int precision); int getPrecision(); @Override String[] binEntry(T entry); @Override byte[] toBinary(); @Override void fromBinary(byte[] bytes); }
GeohashBinningStrategy implements AggregationBinningStrategy<T> { @Override public String[] binEntry(T entry) { Geometry geometry = this.getGeometry(entry); return geometry == null ? null : new String[] {encodeToGeohash(geometry, this.precision)}; } GeohashBinningStrategy(int precision); int getPrecision(); @Override String[] binEntry(T entry); @Override byte[] toBinary(); @Override void fromBinary(byte[] bytes);  }