5 releases (breaking)
0.5.0 | Nov 21, 2022 |
---|---|
0.4.0 | Nov 21, 2022 |
0.3.0 | Nov 21, 2022 |
0.2.0 | Nov 14, 2022 |
0.1.0 | Nov 12, 2022 |
#4 in #geocode
12KB
269 lines
Plus codes
Plus codes is an implementation of plus codes in Rust. It can be used either as a command line tool or as a crate.
As command line tool
- Install and setup Rust and Cargo
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
As a Rust crate
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 {...}
Dependencies
~7MB
~124K SLoC