Crate spatialtime

Source
Expand description

A very simple library to lookup timezone data based on longitude and latitude (offline).

§Usage

let response = spatialtime::osm::lookup(-77.0365, 38.8977).unwrap();
/***
 *  OSM dataset does not include offset, just tzid
 *  OsmResponse { tzid: "America/New_York" }
 ***/
let response = spatialtime::ned::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 dataset. Much smaller at 890KB.
  • osm - Uses the OpenStreetMap dataset. Much larger at 17.9MB, but potentially more “accurate” and “up-to-date”

Modules§

ned
Lookup using the NED dataset
osm
Lookup using OSM dataset

Enums§

SpatialtimeError
Custom errors