I’d like to get the 8 neighbors of the geohash grid. For example, the neighbors of the hashcode dqcjqc
are dqcjqf
,dqcjqb
,dqcjr1
,dqcjq9
,dqcjqd
,dqcjr4
,dqcjr0
,dqcjq8
.
I wonder how to do it in PostGIS?
PS: I know there's an implementation in R: https://rdrr.io/cran/geohash/man/neighbours.html
and an implmentation in Javascript: https://github.com/davetroy/geohash-js
geohashTools
is anyone wants to look at the algorithm used there: cran.r-project.org/web/packages/geohashTools/index.html code: github.com/MichaelChirico/geohashTools