kungfoo / geohash-java

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

add validation for negative numberOfBits in GeoHash.withBitPrecision #59

Closed satorg closed 2 years ago

satorg commented 2 years ago

Resolves #58

kungfoo commented 2 years ago

Thanks for adding the validation. Arguably a Geohash with a bit length of 0 also does also not make much senser, but there may be uses for it, so I'd rather not break that behaviour.

satorg commented 2 years ago

@kungfoo zero bit precision seems to be fine. Although perhaps it is not practically useful, but it expresses the idea of zero precision itself pretty well – i.e. a geohash that covers the whole Earth. Therefore I wouldn't like to break it either.

satorg commented 2 years ago

@kungfoo just to clarify with you: does this PR make any sense? I'm absolutely ok to close it if it does not.

kungfoo commented 2 years ago

It does make sense but I was away from any PCs for a while there...