tzw

tzwhere

python library to look up timezone from lat lng offline

Showing:

Popularity

Downloads/wk

0

GitHub Stars

128

Maintenance

Last Commit

4yrs ago

Contributors

17

Package

Dependencies

0

License

MIT License

Categories

Readme

pytzwhere Build Status Coverage Status

pytzwhere is a Python library to lookup the timezone for a given lat/lng entirely offline.

Version 3.0 fixes how pytzwhere deals with holes in timezones. It is recommended that you use version 3.0.

It is a port from https://github.com/mattbornski/tzwhere with a few improvements. The underlying timezone data is based on work done by Eric Muller

If used as a library, basic usage is as follows:

>>> from tzwhere import tzwhere
>>> tz = tzwhere.tzwhere()
>>> print tz.tzNameAt(35.29, -89.66)
America/Chicago

The polygons used for building the timezones are based on VMAP0. Sometimes points are outside a VMAP0 polygon, but are clearly within a certain timezone (see also this discussion). As a solution you can search for the closest timezone within a user defined radius.

Dependencies:

  • numpy (optional)

  • shapely

forceTZ

If the coordinates provided are outside of the currently defined timezone boundaries, the tzwhere function will return None. If you would like to match to the closest timezone, use the forceTZ parameter.

Example:

>>> from tzwhere import tzwhere
>>> tz = tzwhere.tzwhere()
>>> print(tz.tzNameAt(53.68193999999999, -6.239169999999998))
None

>>> from tzwhere import tzwhere
>>> tz = tzwhere.tzwhere(forceTZ=True)
>>> print(tz.tzNameAt(53.68193999999999, -6.239169999999998, forceTZ=True))
Europe/Dublin

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100