update-regex-latlong-parsing

#25
by jerpint - opened
Files changed (1) hide show
  1. src/utils.py +2 -2
src/utils.py CHANGED
@@ -65,8 +65,8 @@ def parse_latlng(latlng):
65
  if re.match(r"\(\d+\.\d+,\s?-\d+\.\d+\)", latlng):
66
  lat, lng = latlng[1:-1].split(",")
67
  return [float(lat), float(lng)]
68
- # check of it matches 30.9529832, -7.1010705 or 30.9529832,-7.1010705
69
- elif re.match(r"\d+\.\d+,\s?-\d+\.\d+", latlng):
70
  lat, lng = latlng.split(",")
71
  return [float(lat), float(lng)]
72
  # check if it matches 30,9529832, -7,1010705 or 30,9529832,-7,1010705, match1=30,9529832 and match2=-7,1010705
 
65
  if re.match(r"\(\d+\.\d+,\s?-\d+\.\d+\)", latlng):
66
  lat, lng = latlng[1:-1].split(",")
67
  return [float(lat), float(lng)]
68
+ # check of it matches 30.9529832, -7.1010705 or 30.9529832,-7.1010705 or 30.9529832 ,-7.10107050
69
+ elif re.match(r"\d+\.\d+\s?,\s?-\d+\.\d+", latlng):
70
  lat, lng = latlng.split(",")
71
  return [float(lat), float(lng)]
72
  # check if it matches 30,9529832, -7,1010705 or 30,9529832,-7,1010705, match1=30,9529832 and match2=-7,1010705