X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/87c91ec5c42089797da1525bd270269b2cd9d3ad..a234d606c9dcd76db1d69909bb78940d3dbcd862:/nominatim/api/types.py diff --git a/nominatim/api/types.py b/nominatim/api/types.py index 3ca023e7..e93015fc 100644 --- a/nominatim/api/types.py +++ b/nominatim/api/types.py @@ -316,7 +316,7 @@ class DataLayer(enum.Flag): for reverse and forward search. """ ADDRESS = enum.auto() - """ The address layer contains all places relavant for addresses: + """ The address layer contains all places relevant for addresses: fully qualified addresses with a house number (or a house name equivalent, for some addresses) and places that can be part of an address like roads, cities, states. @@ -415,7 +415,7 @@ class LookupDetails: more the geometry gets simplified. """ locales: Locales = Locales() - """ Prefered languages for localization of results. + """ Preferred languages for localization of results. """ @classmethod @@ -538,11 +538,13 @@ 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: - """ Check if the given layer has been choosen. Also returns + """ Check if the given layer has been chosen. Also returns true when layer restriction has been disabled completely. """ return self.layers is None or bool(self.layers & layer)