nearest_postcode function

Nearest postcode

Nearest postcode

Returns nearest postcodes for a given postcode. The search is based on the relative distance of the postcode centroid.

nearest_postcode(postcode, limit = 10, radius = 100)

Arguments

  • postcode: A string. Valid UK postcode.
  • limit: A string or integer. Limits number of postcodes matches to return. Defaults to 10. Needs to be lower than 100.
  • radius: Limits number of postcodes matches to return. Defaults to 100m. Needs to be less than 2,000m.

Returns

A list of geographic properties of the nearest postcode.

Examples

nearest_postcode("EC1Y 8LX") nearest_postcode("EC1Y 8LX", limit = 11) nearest_postcode("EC1Y 8LX", limit = 12, radius = 200)