geometry-api-java
geometry-api-java copied to clipboard
Support for serializing/deserializing geometry to geohash?
I'm looking to see if implementing Geometry <-> Geohash functionality would be something that would be welcomed for inclusion in this library. I know there are other Java libraries to do Geohashing, but looking for something that explicitly constructs a java.com.esri.core.geometry.Geometry instance. Thanks!
@JimBlaney What types of geometry would you convert to and from geohash?
My particular use case includes:
- point -> geohash
- geohash -> envelope
- geohash -> point (centroid)
Preferably this should be a standalone Geohash class. class Geohash: static Envelope2D geohashToEnvelope(String geoHash) - envelope of the geohash cell. static String toGeohash(Point2D pt, int characterLength) - converts a point to the geohash of given length. Other direction of conversion is to use geohashToEnvelope and get the envelope center. static String containingGeohash(Envelope2D envelope) - longest geohash that contains the envelope static String[] coveringGeohash(Envelope2D envelope) - up to four geohashes that completely cover given envelope.