1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*!
A very simple library to lookup timezone data based on longitude and latitude (offline).
## Usage
```
let reader = spatialtime::osm::OsmReader::new().unwrap();
let response = reader.lookup(-77.0365, 38.8977).unwrap();
/***
* OSM dataset does not include offset, just tzid
* OsmResponse { tzid: "America/New_York" }
***/
let reader = spatialtime::ned::NedReader::new().unwrap();
let response = reader.lookup(149.1165, -35.3108).unwrap();
/***
* NED dataset will always contain offset, but might not have a tzid
* NedResponse { offset: 10.0, tzid: Some("Australia/Sydney") }
***/
```
## Crate features
By default, this crate will not include any functionality. You need to explicitly enable the
**ned** and/or **osm** features.
* **ned** -
Uses the [Natural Earth](https://www.naturalearthdata.com/) dataset. Much smaller at 890KB.
* **osm** -
Uses the [OpenStreetMap](https://www.openstreetmap.org/) dataset. Much larger at 17.9MB, but
potentially more "accurate" and "up-to-date"
*/
use Error;
/// Lookup using the NED dataset
/// Lookup using OSM dataset
/// Shared functionlaity and structs. used internally
/// Custom errors