Search in sources :

Example 1 with LatLong

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));
}
Also used : Envelope(org.locationtech.jts.geom.Envelope) LatLong(com.github.davidmoten.geo.LatLong)

Aggregations

LatLong (com.github.davidmoten.geo.LatLong)1 Envelope (org.locationtech.jts.geom.Envelope)1