Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/UA3MQJ/wheretz
Time zone by geo coordinates lookup
https://github.com/UA3MQJ/wheretz
Last synced: 3 months ago
JSON representation
Time zone by geo coordinates lookup
- Host: GitHub
- URL: https://github.com/UA3MQJ/wheretz
- Owner: UA3MQJ
- License: mit
- Created: 2019-12-09T16:47:55.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-21T12:46:00.000Z (3 months ago)
- Last Synced: 2024-10-21T19:37:27.732Z (3 months ago)
- Language: Elixir
- Size: 105 MB
- Stars: 11
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Elixir version of Ruby gem for lookup of timezone by georgraphic coordinates. (Geolocation)
- fucking-awesome-elixir - wheretz - Elixir version of Ruby gem for lookup of timezone by georgraphic coordinates. (Geolocation)
- awesome-elixir - wheretz - Elixir version of Ruby gem for lookup of timezone by georgraphic coordinates. (Geolocation)
README
# WhereTZ: timezone lookup
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Build Status](https://travis-ci.org/UA3MQJ/wheretz.svg?branch=master)](https://travis-ci.org/UA3MQJ/wheretz?branch=master)
[![Hex.pm Version](http://img.shields.io/hexpm/v/wheretz.svg?style=flat)](https://hex.pm/packages/wheretz)
[![Coverage Status](https://coveralls.io/repos/github/UA3MQJ/wheretz/badge.svg?branch=master)](https://coveralls.io/github/UA3MQJ/wheretz?branch=master)
[![Inline docs](http://inch-ci.org/github/UA3MQJ/wheretz.svg)](http://inch-ci.org/github/UA3MQJ/wheretz)**WhereTZ** is elixir version of Ruby gem for lookup of timezone by georgraphic coordinates.
https://github.com/zverok/wheretz
Features:
* no calls to external services, works without Internet connection;
* Timezone result is [%Timex.TimezoneInfo](https://hexdocs.pm/timex/Timex.TimezoneInfo.html#t:t/0)## Usage
Add to project from hex.pm
```elixir
def deps do
[
{:wheretz, "~> 0.1.17"},
]
end
```or from github
```elixir
def deps do
[
{:wheretz, git: "[email protected]:UA3MQJ/wheretz.git", tag: "v0.1.17"},
]
end
```Before the first start, you need to download the geo and initializse the database.
```elixir
mix where_tz.init
```usage
```elixir
iex(1)> WhereTZ.get(50.004444, 36.231389)
#
iex(2)> WhereTZ.lookup(50.004444, 36.231389)
"Europe/Kiev"
```## How it works
1. Latest version of [timezone-boundary-builder](https://github.com/evansiroky/timezone-boundary-builder) dataset is converted into mnesia table (125Mb);
2. For each time zone, store timezone name, geo polygon and calculate _bounding box_ (min and max latitude and longitude);
3. On each lookup `WhereTZ` first checks provided coordinates by bounding
boxes, and if only one bbox, corresponds to them, returns timezone name immediately;
4. If there's several intersecting bounding boxes, `WhereTZ` checks which
polygon actually contains the point.## Known problems
* ?
## Author
Alexey Bolshakov
## Thanks to
[Victor Shepelev](http://zverok.github.io/)
## License
Data license is [ODbL](https://opendatacommons.org/licenses/odbl/).
Code license is usual MIT.