# get the neighborhood of this geohash in downtown Apia as an sp object
downtown = '2jtc5x'
apia_nbhd = unlist(gh_neighbors(downtown))
apia_sp = gh_to_sp(apia_nbhd)
# all geohashes covering a random sampling within Apia:
apia_covering = gh_covering(smp <- sp::spsample(apia_sp, 10L, 'random'))
apia_sf = gh_to_sf(apia_nbhd)
Run the code above in your browser using DataCamp Workspace