neighbours: Get neighbours to geohashes

Description Usage Arguments See Also Examples

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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

1
2
3
4
5
#Get a single neighbours
north("ezs42")

#Get all neighbours!
gh_neighbours("ezs42")

Example output

[1] "ezs48"
  north northeast  east southeast south southwest  west northwest
1 ezs48     ezs49 ezs43     ezs41 ezs40     ezefp ezefr     ezefx

geohash documentation built on Aug. 2, 2017, 5:01 p.m.