powered by
compute geohash from (average) coordinates (requires lwgeom)
st_geohash(x, precision = 0)
object of class sf, sfc or sfg
sf
sfc
sfg
integer; precision (length) of geohash returned; when omitted, precision 10 is taken.
character vector with geohashes
see http://geohash.org/ or https://en.wikipedia.org/wiki/Geohash. in case a geometry contains more than one point, the geohash for the average of the points in the geometry is returned.
if (!is.na(sf_extSoftVersion()["lwgeom"])) { st_geohash(st_sfc(st_point(c(1.5,3.5)), st_point(c(0,90))), 2) st_geohash(st_sfc(st_point(c(1.5,3.5)), st_point(c(0,90))), 10) }
Run the code above in your browser using DataLab