Search code examples
geotoolsgeohashing

Can Geotools create a Geohash from a lat and lon?


Recently I have been using the Geotools library (http://docs.geotools.org/latest/javadocs/) to process some simple geo data. However, the library is so robust that it is surprising to me that it doesn't seem to provide the capability to create geohash from a lat and lon. Can anyone point me in the direction for documentation on how to use the Geotools library to create a geohash?


Solution

  • You could use a Java Geoshash library to do the task:

    https://github.com/kungfoo/geohash-java

    Following the Test Cases examples:

    https://github.com/kungfoo/geohash-java/blob/master/src/test/java/ch/hsr/geohash/GeoHashTest.java

    There are another libs:

    Java is rich in libraries and frameworks, use all you need :)