+# 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.
"""
@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:
@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:
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)