#timezone #position

tz-search

Compute the timezone of latitude/longitude pairs

2 releases

Uses old Rust 2015

0.1.1 Apr 24, 2015
0.1.0 Apr 9, 2015

#7 in #position

Download history 21/week @ 2021-06-29 38/week @ 2021-07-06 54/week @ 2021-07-13 43/week @ 2021-07-20 28/week @ 2021-07-27 66/week @ 2021-08-03 120/week @ 2021-08-10 195/week @ 2021-08-17 94/week @ 2021-08-24 18/week @ 2021-08-31 20/week @ 2021-09-07 13/week @ 2021-09-14 11/week @ 2021-09-21 44/week @ 2021-09-28 25/week @ 2021-10-05 16/week @ 2021-10-12

266 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

~1MB
~21K SLoC