From: Vladislav Skukov Date: Sat, 18 May 2019 20:25:08 +0000 (+0500) Subject: fix districts search X-Git-Url: https://git.xn--bdkaa.com/?a=commitdiff_plain;h=46006c29063fb7fe477a7685bb6487ad8ccb9527;p=where-are-you.py.git fix districts search --- diff --git a/osm/osm.py b/osm/osm.py index 0d2ead3..36c0ccc 100644 --- a/osm/osm.py +++ b/osm/osm.py @@ -5,7 +5,7 @@ import re Api = OsmApi() pp = pprint.PrettyPrinter(indent=4) -min_lon, min_lat, max_lon, max_lat = 60.615948,56.803766,60.65337,56.820586 +min_lon, min_lat, max_lon, max_lat = 37.634090753,55.7350616076,37.6530593351,55.7373086289 def remove_duplicates(l): return [dict(t) for t in {tuple(d.items()) for d in l}] @@ -85,7 +85,8 @@ def filter_districts(objects): o['data']['tag'] != {} and 'type' in o['data']['tag'] and (o['data']['tag']['type'] == 'boundary' or 'boundary' in o['data']['tag']) - and 'name' in o['data']['tag'], objects)) + and 'name' in o['data']['tag'] + and 'район' in o['data']['tag']['name'], objects)) def describe_objects(min_lat, min_lon, max_lat, max_lon): objects = get_objects_from_square(min_lon, min_lat, max_lon, max_lat)