{"id":15405674,"url":"https://github.com/zverok/wheretz","last_synced_at":"2025-04-05T23:08:49.072Z","repository":{"id":3690808,"uuid":"50592574","full_name":"zverok/wheretz","owner":"zverok","description":"Fast and precise time zone by geo coordinates lookup","archived":false,"fork":false,"pushed_at":"2022-03-11T12:02:01.000Z","size":92145,"stargazers_count":100,"open_issues_count":3,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-29T22:06:27.988Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zverok.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-28T15:32:24.000Z","updated_at":"2025-02-06T00:38:23.000Z","dependencies_parsed_at":"2022-08-06T14:15:18.664Z","dependency_job_id":null,"html_url":"https://github.com/zverok/wheretz","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zverok%2Fwheretz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zverok%2Fwheretz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zverok%2Fwheretz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zverok%2Fwheretz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zverok","download_url":"https://codeload.github.com/zverok/wheretz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411234,"owners_count":20934653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T16:18:03.875Z","updated_at":"2025-04-05T23:08:49.039Z","avatar_url":"https://github.com/zverok.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"WhereTZ: fast and precise timezone lookup\n=========================================\n\n**WhereTZ** is a small gem for lookup of timezone by georgraphic\ncoordinates.\n\nFeatures:\n\n* quite precise: uses [timezone-boundary-builder](https://github.com/evansiroky/timezone-boundary-builder), which takes source data from OpenStreetMap;\n* (relatively) fast: 0.1-0.2 sec for lookup in worst cases and almost immediate lookup for best cases;\n* no calls to external services, works without Internet connection;\n* no keeping some 50 Mb datafiles in memory or reading them from disk for each call;\n* can return timezone name string or `TZInfo::Timezone`.\n\n## Usage\n\nInstall it with your usual routines (Gemfile or `gem install`) as `wheretz` gem. Then:\n\n```ruby\nrequire 'wheretz'\n\nWhereTZ.lookup(50.004444, 36.231389) # (lat, lng) order\n# =\u003e 'Europe/Kiev'\n\nWhereTZ.get(50.004444, 36.231389)\n# =\u003e #\u003cTZInfo::DataTimezone: Europe/Kiev\u003e\n\n# you should have tzinfo gem installed, wheretz doesn't list it as dependency\n```\n\nFrom command-line, after gem installed:\n\n```bash\nwheretz 50.004444,36.231389\n# =\u003e Europe/Kiev\n```\n\n## How it works\n\n1. Latest version of [timezone-boundary-builder](https://github.com/evansiroky/timezone-boundary-builder) dataset is converted into ~400 `data/*.geojson` files;\n2. Each of those files corresponds to one timezone; filename contains timezone name and _bounding box_ (min and max latitude and longitude);\n3. On each lookup `WhereTZ` first checks provided coordinates by bounding boxes, and if only one bbox (extracted from filename) corresponds to them, returns timezone name immediately;\n4. If there's several intersecting bounding boxes, `WhereTZ` reads only relevant timezone files (which are not very large) and checks which polygon actually contains the point.\n\n## Known problems\n\n* Loading/unloading `.geojson` files can be uneffective when called  multiple times; future releases will provide option for preserve data in memory, or for mass lookup of points;\n* You should note that gem has ≈50 MiB of datafiles inside;\n* Data conversion performed by pretty ugly script (instead of Rake task as it should be).\n\n## Author\n\n[Victor Shepelev](http://zverok.github.io/)\n\n## License\n\nData license is [ODbL](https://opendatacommons.org/licenses/odbl/).\n\nCode license is usual MIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzverok%2Fwheretz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzverok%2Fwheretz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzverok%2Fwheretz/lists"}