Skip to content
/ tzwhere Public

Time zone lookup by latitude/longitude using nearest neighbor implementation

License

Notifications You must be signed in to change notification settings

adam12/tzwhere

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TZWhere

Lookup a time zone by latitude/longitude using the nearest neighbor method.

Caveats

The nearest neighbor method can sometimes be inacurrate, if compared to a point lookup in a polygon. In most cases, the risk of inaccuracy is acceptable.

Installation

Add this line to your application's Gemfile:

gem 'tzwhere'

And then execute:

$ bundle

Or install it yourself as:

$ gem install tzwhere

Usage

TZWhere.lookup(41.7599, -87.2079)

# => "America/Chicago"

Running Tests

Ensure the test dependencies are installed:

$ bundle

Run the test suite:

$ rake test

Contributing

See CONTRIBUTING.md

Copyright

Copyright (c) 2014 Adam Daniels (adam@mediadrive.ca).

Geocode data (points.dat) by Geonames.org is licensed under CC BY 3.0

See LICENSE for details.

About

Time zone lookup by latitude/longitude using nearest neighbor implementation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages