Not sure how directly useful this is, but it would be helpful to other functions (e.g. gh_grid and gh_distance).
The idea is to take points and "round" them to their current geohash centroid (or perhaps to any of the nine "cardinal" points of a geohash?).
This is simpler to do than geohash encoding as it can be done with simple vectorized arithmetic, e.g.:
# in lower-left; add gh_delta to get centroid
gh-1: (lat, lon) -> ( 45*(lat %/% 45), 45*(lon %/% 45) )
gh-2: (lat, lon) -> ( 5.625*(lat %/% 5.625), 11.25*(lon %/% 11.25))
Not sure how directly useful this is, but it would be helpful to other functions (e.g.
gh_gridandgh_distance).The idea is to take points and "round" them to their current geohash centroid (or perhaps to any of the nine "cardinal" points of a geohash?).
This is simpler to do than geohash encoding as it can be done with simple vectorized arithmetic, e.g.: