From 5b52e52c6e84243fbf18aef880e61caa0b8c4e8c Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Fri, 14 May 2021 13:53:18 +0200 Subject: [PATCH] Add some tags in OSM search --- web_view.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web_view.py b/web_view.py index 081b357..ca866aa 100755 --- a/web_view.py +++ b/web_view.py @@ -755,8 +755,15 @@ def get_nearby(bbox, item, max_distance=200): func.ST_Intersects(db_bbox, cls.way), func.ST_Area(cls.way) < 20 * func.ST_Area(db_bbox), or_(*tag_filter)) - .order_by(point.distance_centroid(cls.way)) - .limit(20)) + .order_by(point.distance_centroid(cls.way))) + + if "Key:amenity" in tag_list: + q = q.filter(cls.tags["amenity"] != "bicycle_parking", + cls.tags["amenity"] != "bicycle_repair_station", + cls.tags["amenity"] != "atm", + cls.tags["amenity"] != "recycling") + + q = q.limit(20) # print(q.statement.compile(compile_kwargs={"literal_binds": True}))