Function geo_rust::get_nearest_postcode_with_bounding
source · pub fn get_nearest_postcode_with_bounding(
location: GeoLocation,
geonames_data: &[PostalData],
threshold: f64
) -> Option<&PostalData>
Expand description
Get the nearest postcode to a location with a bounding box. Used to filter out postcodes that are too far away.
§Arguments
location
- ALocation
struct representing the location.geonames_data
- A slice ofPostalData
structs.threshold
- Af64
representing the maximum distance in kilometers.
§Returns
An Option
containing a reference to the nearest PostalData
struct.