+ api = napi.NominatimAPI(args.project_dir)
+
+ locales = args.get_locales(api.config.DEFAULT_LANGUAGE)
+ result = api.details(place,
+ address_details=args.addressdetails,
+ linked_places=args.linkedplaces,
+ parented_places=args.hierarchy,
+ keywords=args.keywords,
+ geometry_output=napi.GeometryFormat.GEOJSON
+ if args.polygon_geojson
+ else napi.GeometryFormat.NONE,
+ locales=locales)
+
+
+ if result:
+ output = api_output.format_result(
+ result,
+ 'json',
+ {'locales': locales,
+ 'group_hierarchy': args.group_hierarchy})
+ # reformat the result, so it is pretty-printed
+ json.dump(json.loads(output), sys.stdout, indent=4, ensure_ascii=False)
+ sys.stdout.write('\n')
+
+ return 0
+
+ LOG.error("Object not found in database.")
+ return 42