Merge pull request #3289 from lonvia/viewbox-and-housenumbers

Do not restrict by viewbox when housenumber or postcode is available
This commit is contained in:
Sarah Hoffmann 2024-01-07 15:23:14 +01:00 committed by GitHub
commit d3a575319f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -663,7 +663,7 @@ class PlaceSearch(AbstractSearch):
sql = sql.where(tsearch.c.centroid
.intersects(VIEWBOX_PARAM,
use_index=details.viewbox.area < 0.2))
elif self.expected_count >= 10000:
elif not self.postcodes and not self.housenumbers and self.expected_count >= 10000:
sql = sql.where(tsearch.c.centroid
.intersects(VIEWBOX2_PARAM,
use_index=details.viewbox.area < 0.5))