X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/22376036775dd5ac785a48efe1e9289332df7e0a..86c4897c9b49610ac0eea5fac0d8eeb67384da36:/nominatim/api/v1/format.py diff --git a/nominatim/api/v1/format.py b/nominatim/api/v1/format.py index 47d2af4d..b50a2346 100644 --- a/nominatim/api/v1/format.py +++ b/nominatim/api/v1/format.py @@ -195,3 +195,36 @@ def _format_reverse_jsonv2(results: napi.ReverseResults, options: Mapping[str, Any]) -> str: return format_json.format_base_json(results, options, True, class_label='category') + + +@dispatch.format_func(napi.SearchResults, 'xml') +def _format_reverse_xml(results: napi.SearchResults, options: Mapping[str, Any]) -> str: + return format_xml.format_base_xml(results, + options, False, 'searchresults', + {'querystring': 'TODO'}) + + +@dispatch.format_func(napi.SearchResults, 'geojson') +def _format_reverse_geojson(results: napi.SearchResults, + options: Mapping[str, Any]) -> str: + return format_json.format_base_geojson(results, options, False) + + +@dispatch.format_func(napi.SearchResults, 'geocodejson') +def _format_reverse_geocodejson(results: napi.SearchResults, + options: Mapping[str, Any]) -> str: + return format_json.format_base_geocodejson(results, options, False) + + +@dispatch.format_func(napi.SearchResults, 'json') +def _format_reverse_json(results: napi.SearchResults, + options: Mapping[str, Any]) -> str: + return format_json.format_base_json(results, options, False, + class_label='class') + + +@dispatch.format_func(napi.SearchResults, 'jsonv2') +def _format_reverse_jsonv2(results: napi.SearchResults, + options: Mapping[str, Any]) -> str: + return format_json.format_base_json(results, options, False, + class_label='category')