Skip to content

thnery/geohash-rb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GeohashRb

Installation

Add this line to your application's Gemfile:

gem 'geohash_rb'

And then execute:

$ bundle

Or install it yourself as:

$ gem install geohash_rb

Usage

From GeoHash to Geolocation

GeohashRb.decode("7nx4jpm")
# => -8.04542542, -34.92897034

From Geolocation to GeoHash

GeohashRb.encode(-8.04542542, -34.92897034, 7)
# => 7nx4jpm

Getting Neighbors

GeohashRb.neighbors("7nx4jpm")
# => ["7nx4jpt", "7nx4jpw", "7nx4jpq", "7nx4jpn", "7nx4jpj", "7nx4jph", "7nx4jpk", "7nx4jps"]

Getting Parent Neighbors

GeohashRb.parent_neighbors("7nx4jpm")
# => ["7nx4jn", "7nx4jq", "7nx4jr", "7nx4jp"]

Getting Adjacents

Set the desired adjacent position parameter as (:left, :right, :top, :bottom)

GeohashRb.adjacent("7nx4jpm", :left)
# => "7nx4jpk"

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mesainc/geohash-rb.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published