Crates.io | geohash-rs |
lib.rs | geohash-rs |
version | 0.1.3 |
source | src |
created_at | 2022-08-19 05:51:20.144055 |
updated_at | 2023-01-13 01:19:09.123845 |
description | A geohash crate for Rust |
homepage | |
repository | https://github.com/DosangGu/geohash-rs |
max_upload_size | |
id | 648566 |
size | 9,796 |
A geohash crate for rust
use geohash_rs;
let geohash = geohash_rs::encode(37.5666805, 126.9784147, 8);
assert_eq!(geohash, String::from("wydm9qyc"))
use geohash_rs;
let gps_bounds = geohash_rs::decode(String::from("wydm9qyc"));
assert_eq!(gps_bounds.latitude[0], 37.56654739379883);
assert_eq!(gps_bounds.latitude[1], 37.56671905517578);
assert_eq!(gps_bounds.longitude[0], 126.97826385498047);
assert_eq!(gps_bounds.longitude[1], 126.97860717773438);