From 3e5dc908fa7cf486f12a6c8d0f6e7d505edd2ecc Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Fri, 16 Jul 2021 11:10:37 +0200 Subject: [PATCH] Adjust distance and limit for nearby OSM --- matcher/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/matcher/api.py b/matcher/api.py index 1b388b4..9f32802 100644 --- a/matcher/api.py +++ b/matcher/api.py @@ -262,7 +262,7 @@ def get_tag_filter(cls, tag_list): return tag_filter -def get_nearby(bbox, item, max_distance=300): +def get_nearby(bbox, item, limit=60, max_distance=400): db_bbox = make_envelope(bbox) osm_objects = {} @@ -300,7 +300,7 @@ def get_nearby(bbox, item, max_distance=300): cls.tags["amenity"] != "atm", cls.tags["amenity"] != "recycling") - q = q.limit(40) + q = q.limit(limit) # print(q.statement.compile(compile_kwargs={"literal_binds": True})) @@ -315,7 +315,7 @@ def get_nearby(bbox, item, max_distance=300): for identifier, dist in sorted(distances.items(), key=lambda i:i[1])] - return nearby[:40] + return nearby[:limit] def get_preset_translations():