kungfoo / geohash-java

Implementation of GeoHashes in java. We try to be/stay compliant to the spec, as far as possible.
Other
982 stars 310 forks source link

Added an iterator to list all of the geohashes within a bounding box #5

Closed ktcorby closed 13 years ago

ktcorby commented 13 years ago

Hi, your GeoHash code is very useful, thanks!

I added a new class which is an iterator to list all of the GeoHashes within a bounding box, at a resolution specified by the number of significant bits. I also added some support methods to GeoHash, including serialization to and from a long value, a next method to get the next GeoHash in the sequence, and a compareTo method. I'm not sure whether it's generally useful, but feel free to pull it if you think so.

One caveat: the points generated by the iterator are not necessarily contained in the original bounding box, especially at low resolutions. This is not a requirement for me but might be confusing.

Thanks, Kevin

kungfoo commented 13 years ago

Groovy! Will merge later when I'm home!