X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/f8bca4fbcb739daa6a89dd52c219713dd1173287..5751686fdce33f6b69a93dd1641ceacb2239791f:/nominatim/api/results.py diff --git a/nominatim/api/results.py b/nominatim/api/results.py index 098851ef..98b13380 100644 --- a/nominatim/api/results.py +++ b/nominatim/api/results.py @@ -173,6 +173,19 @@ class ReverseResults(List[ReverseResult]): """ +@dataclasses.dataclass +class SearchResult(BaseResult): + """ A search result for forward geocoding. + """ + bbox: Optional[Bbox] = None + + +class SearchResults(List[SearchResult]): + """ Sequence of forward lookup results ordered by relevance. + May be empty when no result was found. + """ + + def _filter_geometries(row: SaRow) -> Dict[str, str]: return {k[9:]: v for k, v in row._mapping.items() # pylint: disable=W0212 if k.startswith('geometry_')}