Skip to content

Commit 7c81143

Browse files
author
MartinMikita
committed
Fixed matching LatLon lowercase.
1 parent 49211da commit 7c81143

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

web/websearch.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -636,11 +636,14 @@ def search(orig_query, query_filter, autocomplete=False, start=0, count=0,
636636
query = query.replace('°', ' ')
637637
query = query.replace('\'', ' ')
638638
query = query.replace('\"', ' ')
639-
latlon = re.compile(r"([-0-9. ]+)([N|S]) *([-0-9. ]+)([E|W])").match(query)
639+
latlon = re.compile(r"([-0-9. ]+)([N|S]) *([-0-9. ]+)([E|W])").match(
640+
query.upper())
640641
if latlon:
641642
def degree_to_float(val, face):
642643
multipler = 1 if face in ['N', 'E'] else -1
643-
return multipler * sum(float(x) / 60 ** n for n, x in enumerate(re.split(r" +", val)))
644+
return multipler * sum(
645+
float(x) / 60 ** n for n, x in enumerate(
646+
re.split(r" +", val)))
644647
lat = degree_to_float(latlon.group(1).strip(), latlon.group(2))
645648
lon = degree_to_float(latlon.group(3).strip(), latlon.group(4))
646649
if lat and lon:
@@ -1113,6 +1116,7 @@ def reverse_search(lon, lat, debug):
11131116
result['matches'] = [smallest_row]
11141117
result['start_index'] = 1
11151118
result['status'] = True
1119+
result['total_found'] = 1
11161120
return result, smallest_distance
11171121

11181122

0 commit comments

Comments
 (0)