- params = ['update.php']
- if args.file:
- params.extend(('--import-file', args.file))
- elif args.diff:
- params.extend(('--import-diff', args.diff))
- elif args.node:
- params.extend(('--import-node', args.node))
- elif args.way:
- params.extend(('--import-way', args.way))
- elif args.relation:
- params.extend(('--import-relation', args.relation))
- if args.use_main_api:
- params.append('--use-main-api')
- return run_legacy_script(*params, nominatim_env=args)
+ osm2pgsql_params = args.osm2pgsql_options(default_cache=1000, default_threads=1)
+ if args.file or args.diff:
+ return add_osm_data.add_data_from_file(args.file or args.diff,
+ osm2pgsql_params)
+
+ if args.node:
+ return add_osm_data.add_osm_object('node', args.node,
+ args.use_main_api,
+ osm2pgsql_params)
+
+ if args.way:
+ return add_osm_data.add_osm_object('way', args.way,
+ args.use_main_api,
+ osm2pgsql_params)
+
+ if args.relation:
+ return add_osm_data.add_osm_object('relation', args.relation,
+ args.use_main_api,
+ osm2pgsql_params)
+
+ return 0