kimlai / tz_world

Resolve timezones from a location.
https://hexdocs.pm/tz_world
MIT License
41 stars 13 forks source link

Rewrite without PostGIS #1

Closed kimlai closed 7 years ago

kimlai commented 7 years ago

Instead of using PostGIS, the lib now uses a data file created using :erlang.term_to_binary, which is a list of tuples, each containing a timezone name, its geometry, and its bounding box.

The lib uses a GenServer that parses the file at startup, and then stores its content as its state.

When using TzWorld.timezone_at/1, a call is sent to the Genserver, that performs the following algorithm: