mirror of
https://github.com/heyarne/berliner-winter.git
synced 2026-05-06 19:23:39 +02:00
Improve query to the google maps geocoding api
This commit is contained in:
parent
b229e1a6c4
commit
872d7b219d
1 changed files with 6 additions and 5 deletions
11
analyze.py
11
analyze.py
|
|
@ -58,9 +58,9 @@ def improve_potential_places(pos_tuples):
|
||||||
for tuple in tuple_list:
|
for tuple in tuple_list:
|
||||||
index += 1
|
index += 1
|
||||||
|
|
||||||
# exclude articles ("the", "a"), they only introduce noise, but
|
# exclude articles ("the", "a") beginning the phrase, they only
|
||||||
# keep the list as a whole
|
# introduce noise, but keep the list as a whole
|
||||||
if tuple[1] == "ART":
|
if tuple[1] == "ART" and index == 0:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# if we have numbers in the middle of our phrase, probably the
|
# if we have numbers in the middle of our phrase, probably the
|
||||||
|
|
@ -104,8 +104,9 @@ def get_geoloc(query):
|
||||||
}
|
}
|
||||||
|
|
||||||
params = {
|
params = {
|
||||||
"address": query,
|
"address": query + ", Berlin",
|
||||||
"components": "country:DE|administrative_area:Berlin",
|
"bounds": "52.6754542,13.7611176|52.33962959999999,13.0891553",
|
||||||
|
"components": "country:DE",
|
||||||
"sensor": False
|
"sensor": False
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue