[][src]Function where39::to_words

pub fn to_words(lat: f64, lng: f64) -> Result<[&'static str; 5], Error<'static>>

Encode coordinates represented as a latitude (in range -90..=+90) and a longitude (in range -180..=+180) to five words. You may shorten the array to four elements according to the original implementation.

Example:

use where39::to_words;

let code = to_words(51.02561728383f64, 13.72333333297f64).unwrap();
let expected = &["slush", "battle", "damage", "dentist"][..];
assert_eq!(expected, &code[..4]);