- print('./utils/update.php --import-*', args)
-
-
-class UpdateIndex:
- """\
- Reindex all new and modified data.
- """
-
- @staticmethod
- def add_args(parser):
- pass
-
- @staticmethod
- def run(args):
- print('./utils/update.php --index', args)
-
-
-class UpdateRefresh:
- """\
- Recompute auxillary data used by the indexing process.
-
- These functions must not be run in parallel with other update commands.
- """
-
- @staticmethod
- def add_args(parser):
- group = parser.add_argument_group('Data arguments')
- group.add_argument('--postcodes', action='store_true',
- help='Update postcode centroid table')
- group.add_argument('--word-counts', action='store_true',
- help='Compute frequency of full-word search terms')
- group.add_argument('--address-levels', action='store_true',
- help='Reimport address level configuration')
- group.add_argument('--importance', action='store_true',
- help='Recompute place importances')
- group.add_argument('--functions', action='store_true',
- help='Update the PL/pgSQL functions in the database')
- group.add_argument('--wiki-data',
- help='Update Wikipedia/data importance numbers.')
- group.add_argument('--website', action='store_true',
- help='Refresh the directory that serves the scripts for the web API')
- group = parser.add_argument_group('Arguments for function refresh')
- group.add_argument('--no-diff-updates', action='store_false', dest='diffs',
- help='Do not enable code for propagating updates')
-
- @staticmethod
- def run(args):
- print('./utils/update.php', args)
-
-
-class AdminCheckDatabase:
- """\
- Check that the database is complete and operational.
- """
-
- @staticmethod
- def add_args(parser):
- pass # No options
-
- @staticmethod
- def run(args):
- print("TODO: ./utils/check_import_finished.php", args)
-
-
-class AdminWarm:
- """\
- Warm database caches for search and reverse queries.
- """
-
- @staticmethod
- def add_args(parser):
- group = parser.add_argument_group('Target arguments')
- group.add_argument('--search-only', action='store_const', dest='target',
- const='search',
- help="Only pre-warm tables for search queries")
- group.add_argument('--reverse-only', action='store_const', dest='target',
- const='reverse',
- help="Only pre-warm tables for reverse queries")
-
- @staticmethod
- def run(args):
- params = ['warm.php']
- if args.target == 'reverse':
- params.append('--reverse-only')
- if args.target == 'search':
- params.append('--search-only')
+ if args.tiger_data:
+ os.environ['NOMINATIM_TIGER_DATA_PATH'] = args.tiger_data
+ return run_legacy_script('setup.php', '--import-tiger-data', nominatim_env=args)
+
+ 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')