Last chance! 50% off unlimited learning
Sale ends in
gh_encode
generates geohashes of a
given precision from vectors of latitude and longitude values.
gh_encode(lats, lngs, precision = 6L)
a numeric vector of latitude values.
a numeric vector of longitude values. Must be the same length
as lat
.
an integer representing the precision the hashes should have. This should be between 1 and 10; if the precision requested is greater than 10, it will use 10 - if less than 1, it will error.
a character vector of hashes, the same length as lat
and lng
,
with NA
values where one of the equivalent lat/lng pair was NA.
gh_decode
, for taking geohashes and turning them back into coordinates,
and gh_neighbours
for retrieving the neighbouring hashes to a particular hash.
# NOT RUN {
# A simple example:
gh_encode(lat = 42.60498046875, lng = -5.60302734375, precision = 5)
#[1] "ezs42"
# }
Run the code above in your browser using DataLab