From: Sarah Hoffmann Date: Wed, 22 Nov 2023 16:01:41 +0000 (+0100) Subject: exclude country-level searches with non-address layers X-Git-Tag: v4.4.0~78^2~5 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/a87fe8d8bf2f4dd784fdb94031bc978b3f28b799 exclude country-level searches with non-address layers --- diff --git a/nominatim/api/types.py b/nominatim/api/types.py index 3ca023e7..5767fe16 100644 --- a/nominatim/api/types.py +++ b/nominatim/api/types.py @@ -538,7 +538,9 @@ class SearchDetails(LookupDetails): or (self.bounded_viewbox and self.viewbox is not None and self.near is not None and self.viewbox.contains(self.near)) - or self.layers is not None and not self.layers) + or (self.layers is not None and not self.layers) + or (self.max_rank <= 4 and + self.layers is not None and not self.layers & DataLayer.ADDRESS)) def layer_enabled(self, layer: DataLayer) -> bool: