X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/345c812e4357087e1568f44e6e9d451e5ee6729a..36a15601174ab238888fcc19621bb647a94d819c:/nominatim/clicmd/api.py?ds=sidebyside diff --git a/nominatim/clicmd/api.py b/nominatim/clicmd/api.py index e0dfab79..ab7d1658 100644 --- a/nominatim/clicmd/api.py +++ b/nominatim/clicmd/api.py @@ -1,3 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# This file is part of Nominatim. (https://nominatim.org) +# +# Copyright (C) 2022 by the Nominatim developer community. +# For a full list of authors see the git log. """ Subcommand definitions for API calls from the command line. """ @@ -154,15 +160,13 @@ class APIReverse: @staticmethod def run(args): - params = dict(lat=args.lat, lon=args.lon) + params = dict(lat=args.lat, lon=args.lon, format=args.format) if args.zoom is not None: params['zoom'] = args.zoom for param, _ in EXTRADATA_PARAMS: if getattr(args, param): params[param] = '1' - if args.format: - params['format'] = args.format if args.lang: params['accept-language'] = args.lang if args.polygon_output: @@ -195,13 +199,11 @@ class APILookup: @staticmethod def run(args): - params = dict(osm_ids=','.join(args.ids)) + params = dict(osm_ids=','.join(args.ids), format=args.format) for param, _ in EXTRADATA_PARAMS: if getattr(args, param): params[param] = '1' - if args.format: - params['format'] = args.format if args.lang: params['accept-language'] = args.lang if args.polygon_output: @@ -258,6 +260,8 @@ class APIDetails: params['class'] = args.object_class for name, _ in DETAILS_SWITCHES: params[name] = '1' if getattr(args, name) else '0' + if args.lang: + params['accept-language'] = args.lang return _run_api('details', args, params)