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 - A Location struct representing the location.
  • geonames_data - A slice of PostalData structs.
  • threshold - A f64 representing the maximum distance in kilometers.

§Returns

An Option containing a reference to the nearest PostalData struct.