Learn R Programming

geohash (version 0.3.0)

gh_neighbours: Get neighbours to geohashes

Description

Geohashes are calculated using a fixed-sized box, which means it's easy to take a geohash and extract the neighbouring boxes around it, in each direction. These functions either extract all neighbours, or individual neighbours, depending on your preference.

Usage

gh_neighbours(hashes)

north(hashes)

northeast(hashes)

east(hashes)

southeast(hashes)

south(hashes)

southwest(hashes)

west(hashes)

northwest(hashes)

Arguments

hashes

a vector of geohashes, which can be computed with gh_encode

See Also

gh_encode for generating hashes and gh_decode for resolving them into latitude and longitude pairs.

Examples

Run this code
# NOT RUN {
#Get a single neighbours
north("ezs42")

#Get all neighbours!
gh_neighbours("ezs42")
# }

Run the code above in your browser using DataLab