Skip to content

Implementation of GeoHashes in java. We try to be/stay compliant to the spec, as far as possible.

License

Notifications You must be signed in to change notification settings

ktcorby/geohash-java

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

java code for geohashes
=======================

An implementation of Geohashes in pure Java.
The produced hashes, when using character precision (multiples of 5 bits) are compatible
to the reference implementation geohash.org.

You can however also encode Geohashes down to the full available precision of a long i.e. 64 bits.


Building/Testing the code
-------------------------

The geohash-java code can be built using Apache Ant or Apache Maven.
Ant targets that are available:

    - clean     # wash dishes.
    - compile   # compile the main source code.
    - test      # (default) run the unit tests.
    - jar       # pack a jar archive with the compiled class files.
    - zip       # pack a zip archive with the compiled binaries, source code and all other files.

Maven targets are the usual suspects.
    
    - compile
    - test
    - package   # pack a versioned jar containing the compiled class files

TODO
----

Current development involves getting the following things to run:

-	a method to find the n closest hashes to any given point.


Last important changes
----------------------

Version 1.0.4
-------------

-   Added/fixed the methods toBinaryString() and Geohash.fromBinaryString() that can encode and decode a geohash into a simple String of 0s and 1s.
-   Also added test code for those methods.

Version 1.0.3
-------------

-   Classes containing data are now Serializable.

Version 1.0.2
-------------

-   Merged Kevins [ktcorby] code that yields all the geohashes in a bounding box, at a given resolution.
-   Merged Chris' [cchandler] code to encode and decode geohashes from a binary string.

Version 1.0.1
-------------

-   Fixed issue #2 from Github:
	- Neighbouring hashes can be calculated by using the getAdjacent() method, which yields a hashes 8 neighbors.
	- northern, eastern, western and southern neighbours can be determined using the respective methods.

-   Fixed issue #1 from Github:
	- A bug caused different hashes to be yielded sometimes.

	
License
-------

This code has been placed under the LGPL. See the LICENSE file for more information.
Please contribute improvements and bug fixes back via github.

About

Implementation of GeoHashes in java. We try to be/stay compliant to the spec, as far as possible.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%