Learn R Programming

geohash (version 0.3.0)

gh_decode: Decode Geohashes

Description

gh_decode takes geohashes and turns them back into latitude/longitude pairs, with an associated margin of error for each value.

Usage

gh_decode(hashes)

Arguments

hashes

a character vector of geohashes.

Value

a data.frame of four columns; "lat", "lng", "lat_error" and "lng_error"

See Also

gh_encode for generating geohashes, and gh_neighbours for identifying the neighbouring hash boxes to a geohash.

Examples

Run this code
# NOT RUN {
# A simple example:
gh_encode(lat = 42.60498046875, lng = -5.60302734375, precision = 5)
#[1] "ezs42"

gh_decode("ezs42")
# lat      lng      lat_error  lng_error
# 42.60498 -5.603027 0.02197266 0.02197266
# }

Run the code above in your browser using DataLab