+ if args.format == 'debug':
+ print(loglib.get_and_disable())
+ return 0
+
+ places = [napi.OsmID(o[0], int(o[1:])) for o in args.ids]
+
+ results = api.lookup(places,
+ address_details=True, # needed for display name
+ geometry_output=args.get_geometry_output(),
+ geometry_simplification=args.polygon_threshold or 0.0,
+ locales=args.get_locales(api.config.DEFAULT_LANGUAGE))
+
+ output = api_output.format_result(
+ results,
+ args.format,
+ {'extratags': args.extratags,
+ 'namedetails': args.namedetails,
+ 'addressdetails': args.addressdetails})
+ if args.format != 'xml':
+ # reformat the result, so it is pretty-printed
+ json.dump(json.loads(output), sys.stdout, indent=4, ensure_ascii=False)
+ else:
+ sys.stdout.write(output)
+ sys.stdout.write('\n')
+
+ return 0