From df7ceeec8782be1c11b31953fdb1cb93fdf80d45 Mon Sep 17 00:00:00 2001 From: Jaisen Mathai Date: Fri, 23 Oct 2020 00:48:19 -0700 Subject: [PATCH] Add support for town when resolving location name #386 (#387) --- elodie/geolocation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/elodie/geolocation.py b/elodie/geolocation.py index 78adace..d43e7be 100644 --- a/elodie/geolocation.py +++ b/elodie/geolocation.py @@ -162,7 +162,9 @@ def place_name(lat, lon): geolocation_info = lookup(lat=lat, lon=lon) if(geolocation_info is not None and 'address' in geolocation_info): address = geolocation_info['address'] - for loc in ['city', 'state', 'country']: + # gh-386 adds support for town + # taking precedence after city for backwards compatability + for loc in ['city', 'town', 'state', 'country']: if(loc in address): lookup_place_name[loc] = address[loc] # In many cases the desired key is not available so we