mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-12-25 05:52:32 +03:00
Change command 'import-special-phrases --from-wiki' to 'special-phrases --import-from-wiki'.
This commit is contained in:
parent
cde9389e75
commit
57ce75eb67
2
.github/workflows/ci-tests.yml
vendored
2
.github/workflows/ci-tests.yml
vendored
@ -120,7 +120,7 @@ jobs:
|
||||
working-directory: data-env
|
||||
|
||||
- name: Import special phrases
|
||||
run: nominatim special-phrases --from-wiki | psql -d nominatim
|
||||
run: nominatim special-phrases --import-from-wiki
|
||||
working-directory: data-env
|
||||
|
||||
- name: Check import
|
||||
|
@ -270,7 +270,7 @@ If you want to be able to search for places by their type through
|
||||
[special key phrases](https://wiki.openstreetmap.org/wiki/Nominatim/Special_Phrases)
|
||||
you also need to import these key phrases like this:
|
||||
|
||||
nominatim import-special-phrases --from-wiki
|
||||
nominatim special-phrases --import-from-wiki
|
||||
|
||||
Note that this command downloads the phrases from the wiki link above. You
|
||||
need internet access for the step.
|
||||
|
@ -7,5 +7,5 @@ require_once(CONST_LibDir.'/init-cmd.php');
|
||||
loadSettings(getcwd());
|
||||
|
||||
(new \Nominatim\Shell(getSetting('NOMINATIM_TOOL')))
|
||||
->addParams('import-special-phrases', '--from-wiki')
|
||||
->addParams('special-phrases', '--import-from-wiki')
|
||||
->run();
|
||||
|
@ -254,7 +254,7 @@ def nominatim(**kwargs):
|
||||
parser.add_subcommand('freeze', clicmd.SetupFreeze)
|
||||
parser.add_subcommand('replication', clicmd.UpdateReplication)
|
||||
|
||||
parser.add_subcommand('import-special-phrases', clicmd.ImportSpecialPhrases)
|
||||
parser.add_subcommand('special-phrases', clicmd.ImportSpecialPhrases)
|
||||
|
||||
parser.add_subcommand('add-data', UpdateAddData)
|
||||
parser.add_subcommand('index', clicmd.UpdateIndex)
|
||||
|
@ -1,5 +1,5 @@
|
||||
"""
|
||||
Implementation of the 'import-special-phrases' command.
|
||||
Implementation of the 'special-phrases' command.
|
||||
"""
|
||||
import logging
|
||||
from nominatim.tools.special_phrases import SpecialPhrasesImporter
|
||||
@ -17,12 +17,12 @@ class ImportSpecialPhrases:
|
||||
@staticmethod
|
||||
def add_args(parser):
|
||||
group = parser.add_argument_group('Input arguments')
|
||||
group.add_argument('--from-wiki', action='store_true',
|
||||
group.add_argument('--import-from-wiki', action='store_true',
|
||||
help='Import special phrases from the OSM wiki to the database.')
|
||||
|
||||
@staticmethod
|
||||
def run(args):
|
||||
if args.from_wiki:
|
||||
if args.import_from_wiki:
|
||||
LOG.warning('Special phrases importation starting')
|
||||
with connect(args.config.get_libpq_dsn()) as db_connection:
|
||||
SpecialPhrasesImporter(
|
||||
|
@ -174,7 +174,7 @@ def test_index_command(mock_func_factory, temp_db_cursor, params, do_bnds, do_ra
|
||||
def test_special_phrases_command(temp_db, mock_func_factory):
|
||||
func = mock_func_factory(nominatim.clicmd.special_phrases.SpecialPhrasesImporter, 'import_from_wiki')
|
||||
|
||||
call_nominatim('import-special-phrases', '--from-wiki')
|
||||
call_nominatim('special-phrases', '--import-from-wiki')
|
||||
|
||||
assert func.called == 1
|
||||
|
||||
|
@ -17,4 +17,4 @@ $aTagsWhitelist
|
||||
= array(
|
||||
'highway' => array('bus_stop', 'rest_area', 'raceway'),
|
||||
'building' => array(),
|
||||
);
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user