geohash icon indicating copy to clipboard operation
geohash copied to clipboard

Allow parsing arbitrarily long geohashes.

Open Fishrock123 opened this issue 3 years ago • 3 comments

This would make backwards compatibility nicer. I know precision wise it is pointless but we have some 16-length geohashes lying around and limiting to 12 is going to make migrating more difficult.

Fishrock123 avatar Oct 25 '21 19:10 Fishrock123

Do you know whether it involves a change to the decode_bbox logic or just to its length check?

urschrei avatar Oct 25 '21 20:10 urschrei

I think that just removing the length check would cause problems, since the first 4 characters would get ignored (in the instance above of a 16 length hash) rather than the last 4, which is undesirable.

Checking if the string is longer than 12 characters and then truncating it if it's too long should work for this purpose, but I do wonder if it might have some undesirable consequences in situations where the hash being too long is in fact an error that the user wants to catch.

cjriley9 avatar Jan 06 '22 02:01 cjriley9

I no longer work at the company that used this, but maybe @ceejbot would have an opininion.

My personal take: add a different function for parsing bounded ones, allow arbitrary by default (unless the geohash spec says otherwise, I don’t recall).

Fishrock123 avatar Jan 06 '22 02:01 Fishrock123