4 releases

0.1.3 Oct 11, 2022
0.1.2 Apr 15, 2022
0.1.1 Apr 15, 2022
0.1.0 Apr 15, 2022

#3 in #geocode

MIT/Apache

15KB
316 lines

Geocodio

A client library for the Geocodio API

Usage

Geocode

use geocodio::GeocodioProxy;

fn main() {
    let geocodio = GeocodioProxy::new().unwrap());
    let response = geocodio
        .geocode(
            AddressParams::AddressInput(AddressInput {
                line_1: "Black Rock Desert".to_string(),
                line_2: None,
                city: "Gerlach".to_string(),
                state: "NV".to_string(),
                country: "US".to_string(),
                postal_code: "89412".to_string(),
            }),
            Some(&["acs-economics", "zip4"]),
        )
        .await
        .unwrap();
   println!(
        "Burning Man is located at the coordinates: ({}, {})",
        response.results[0].location.latitude, response.results[0].location.longitude
    )
}

Dependencies

~6–20MB
~293K SLoC