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:
filter out timezones whose bounding box does not contain the given
point
return the first of the resulting timezones whose geometry contains
the given point (it's usually the first one)
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
, acall
is sent to the Genserver, that performs the following algorithm: