2 releases

Uses old Rust 2015

0.1.1 Apr 24, 2015
0.1.0 Apr 9, 2015

#26 in #latitude-longitude

Download history 25/week @ 2024-07-20 30/week @ 2024-07-27 31/week @ 2024-08-03 43/week @ 2024-08-10 33/week @ 2024-08-17 37/week @ 2024-08-24 32/week @ 2024-08-31 87/week @ 2024-09-07 82/week @ 2024-09-14 108/week @ 2024-09-21 129/week @ 2024-09-28 95/week @ 2024-10-05 91/week @ 2024-10-12 103/week @ 2024-10-19 155/week @ 2024-10-26 83/week @ 2024-11-02

450 downloads per month

Apache-2.0

290KB
234 lines

tz-search

Build Status

Map a latitude/longitude point to the timezone it lies in.

This is a direct port of bradfitz/latlong.

Documentation, crates.io.


lib.rs:

Compute timezones of points on the Earth.

This is a direct port of bradfitz/latlong, and hence the same bonuses/caveats apply:

It tries to have a small binary size (~360 KB), low memory footprint (~1 MB), and incredibly fast lookups (~0.5 microseconds). It does not try to be perfectly accurate when very close to borders.

Source.

Installation

Add the following to your Cargo.toml:

[dependencies]
tz-search = "0.1"

Examples

assert_eq!(tz_search::lookup(-33.79, 151.17).unwrap(),
           "Australia/Sydney");

// in the ocean
assert_eq!(tz_search::lookup(0.0, 0.0), None);

Dependencies

~1–1.3MB
~25K SLoC