From a87fe8d8bf2f4dd784fdb94031bc978b3f28b799 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Wed, 22 Nov 2023 17:01:41 +0100 Subject: [PATCH] exclude country-level searches with non-address layers --- nominatim/api/types.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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: -- 2.39.5