Coder Social home page Coder Social logo

sidhande / geoinfo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from diatmpravin/geoinfo

0.0 1.0 0.0 283 KB

GeoInfo gem offers comprehensive and reliable databases of localities and zip codes for numerous state of india. Such data may be integrated to professional software, websites, may be used to generate statistics and to various other ends. Gem will provide localities, administrative subdivisions, state and geographical coordinates.

License: MIT License

geoinfo's Introduction

Geoinfo

GeoInfo gem offers comprehensive and reliable databases of localities and zip codes for numerous state of india. Such data may be integrated to professional software, websites, may be used to generate statistics and to various other ends. Gem will provide localities, administrative subdivisions, state and geographical coordinates.

(follow readme for installation steps)

This gem allows you to perform the following conversions:

A zipcode to a place
A zipcode to a country
A zipcode to a state
A zipcode to a state code
A zipcode to a district
A zipcode to a Latitude
A zipcode to a Longitude

Installation

Add this line to your application's Gemfile:

gem 'geoinfo'

And then execute:

$ bundle

Or install it yourself as:

$ gem install geoinfo

Example

<%= zip_code.to_region %>
<%= zip_code.to_region(:state => true) %>
<%= zip_code.to_region(:district => true) %>
<%= zip_code.to_region(:country => true) %>
<%= zip_code.to_region(:lat => true) %>
<%= zip_code.to_region(:log => true) %>
<%= zip_code.to_region(:state_code => true) %>

Usage

Convert a zip code to a place

'713301'.to_region #=> Asansol Bazar
'713301'.to_region(:state => true) #=> West Bengal 
'713301'.to_region(:district => true) #=> Burdwan
'713301'.to_region(:country => true) #=> India
'713301'.to_region(:state_code => true) #=> WB

Convert a zip code to a STATE

'713301'.to_region(:lat => true) #=> 23.6306
'713301'.to_region(:log => true) #=> 87.1196

Convert a place to a zip code

'Asansol Bazar'.to_region.to_zip #=> 713301 
'Mahil Gaila'.to_region.to_zip #=> 144506

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

geoinfo's People

Contributors

diatmpravin avatar

Watchers

 avatar

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.