Giter VIP home page Giter VIP logo

geohash-rb's Introduction

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.

geohash-rb's People

Contributors

henriquemenezes avatar luizpaulogodoy avatar thnery avatar

Watchers

 avatar

Forkers

mesainc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.