Switch from ST_Covers to ST_Intersects

This commit is contained in:
Edward Betts 2021-05-10 10:35:45 +02:00
parent 470a206138
commit 70dad3cdac
1 changed files with 3 additions and 1 deletions

View File

@ -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: