Crates.io | pluscodes |
lib.rs | pluscodes |
version | 0.5.0 |
source | src |
created_at | 2022-11-12 23:46:22.842901 |
updated_at | 2022-11-21 22:30:58.841683 |
description | An implementation of plus codes, to be used as CLI tool or crate |
homepage | |
repository | https://github.com/janne/pluscodes-rs |
max_upload_size | |
id | 713875 |
size | 18,612 |
Plus codes is an implementation of plus codes in Rust. It can be used either as a command line tool or as a crate.
cargo install pluscodes
Try it out with:
pluscodes help
pluscodes encode 59.335938,18.077813
pluscodes encode 59.335938,18.077813 --length 6
pluscodes decode 9FFW83PH+94
cargo add pluscodes
let coord = pluscodes::Coord {
latitude: 59.335938,
longitude: 18.077813,
};
pluscodes::encode(&coord, 10) // => "9FFW83PH+94"
pluscodes::encode(&coord, 6) // => "9FFW8300+"
pluscodes::decode("9FFW83PH+94") // => pluscodes::Coord {...}