]> git.openstreetmap.org Git - nominatim.git/commitdiff
exclude country-level searches with non-address layers
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 22 Nov 2023 16:01:41 +0000 (17:01 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 22 Nov 2023 16:01:41 +0000 (17:01 +0100)
nominatim/api/types.py

index 3ca023e7bbe1c7dce2a82a8b510c248a029d8721..5767fe1604a7d31e5b1adffdf3699adf8420a439 100644 (file)
@@ -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: