use of com.github.davidmoten.geo.LatLong in project geowave by locationtech.
the class GeohashBinningHelper method getBinGeometry.
@Override
public Geometry getBinGeometry(final ByteArray bin, final int precision) {
final double halfWidth = GeoHash.widthDegrees(precision) / 2;
final double halfHeight = GeoHash.heightDegrees(precision) / 2;
final LatLong ll = GeoHash.decodeHash(bin.getString());
return GeometryUtils.GEOMETRY_FACTORY.toGeometry(new Envelope(ll.getLon() - halfWidth, ll.getLon() + halfWidth, ll.getLat() - halfHeight, ll.getLat() + halfHeight));
}