A minimal wrapper for the Base Adresse Nationale "BAN" french geo API.
This crate provides functions to query geographical address information from the Base Adresse Nationale API.
Features
- Forward geocoding: convert address strings into coordinates
- Reverse geocoding: convert coordinates into address details
Example
use france_api_adresse;
let api = BANdefault;
let search = api.geocode;
// Narrow the results to post code 74380
let search = search.postcode;
// Narrow the results to city "Cranves-Sales"
let search = search.city;
// Get the results
let result = search.execute_blocking.unwrap;
for result in result.features
You can use async mode by enabling the async feature in your Cargo.toml. Example:
async
Errors
Errors are returned as a custom Error enum to distinguish between HTTP,
text extraction, and JSON deserialization failures.