From 70dad3cdacbccf6737fd433ef4ef5d0277c78e7a Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Mon, 10 May 2021 10:35:45 +0200 Subject: [PATCH] Switch from ST_Covers to ST_Intersects --- web_view.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web_view.py b/web_view.py index fe3300d..d69c541 100755 --- a/web_view.py +++ b/web_view.py @@ -96,7 +96,9 @@ def get_osm_with_wikidata_tag(bbox): seen = set() for cls in (model.Point, model.Polygon, model.Line): q = cls.query.filter( - cls.tags.has_key("wikidata"), func.ST_Covers(db_bbox, cls.way) + cls.tags.has_key("wikidata"), + func.ST_Intersects(db_bbox, cls.way), + func.ST_Area(cls.way) < 20 * func.ST_Area(db_bbox), ) for osm in q: if osm.identifier in seen: