[−][src]Crate geocoding
This crate provides forward– and reverse-geocoding functionality for Rust.
Over time, a variety of providers will be added. Each provider may implement one or both
of the Forward
and Reverse
traits, which provide forward– and reverse-geocoding methods.
Note that for the reverse
method, the return type is simply Option<String>
,
as this is the lowest common denominator reverse-geocoding result.
Individual providers may implement additional methods, which return more
finely-structured and/or extensive data, and enable more specific query tuning.
Coordinate data are specified using the Point
struct, which has several
convenient From
implementations to allow for easy construction using primitive types.
A note on Coordinate Order
While individual providers may specify coordinates in either [Longitude, Latitude]
or
[Latitude, Longitude
] order,
Geocoding
always requires Point
data in [Longitude, Latitude]
(x, y
) order,
and returns data in that order.
Re-exports
pub use crate::opencage::Opencage; |
pub use crate::openstreetmap::Openstreetmap; |
pub use crate::geoadmin::GeoAdmin; |
Modules
geoadmin | The GeoAdmin (https://api3.geo.admin.ch) provider for geocoding in Switzerland exclusively. |
opencage | The OpenCage Geocoding provider. |
openstreetmap | The OpenStreetMap Nominatim provider. |
Structs
Coordinate | A lightweight struct used to store coordinates on the 2-dimensional Cartesian plane. |
InputBounds | Used to specify a bounding box to search within when forward-geocoding |
Point | A single point in 2D space. |
Enums
GeocodingError | Errors that can occur during geocoding operations |
Traits
Forward | Forward-geocode a coordinate. |
Reverse | Reverse-geocode a coordinate. |