From 1a8ad9e035ad77be70c0e8431526dcea18f2d745 Mon Sep 17 00:00:00 2001 From: Aliliche Larbi Date: Tue, 30 May 2023 13:14:46 +0200 Subject: [PATCH] Fix issue: IndexError: list index out of range Some gps_coordinates in the json files have ',' instead of '/' to separate latitude and longitude. This leads to the issue. Handle this case. --- generate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generate.py b/generate.py index bab5f88..f1dc4c1 100755 --- a/generate.py +++ b/generate.py @@ -91,8 +91,8 @@ locations += 1 - lat = location['gps_coordinates'].split('/')[0] - lon = location['gps_coordinates'].split('/')[1] + lat= re.split('/|,',location['gps_coordinates'])[0] + lon= re.split('/|,',location['gps_coordinates'])[1] name_full = name