mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
Change command 'import-special-phrases --from-wiki' to 'special-phrases --import-from-wiki'.
This commit is contained in:
2
.github/workflows/ci-tests.yml
vendored
2
.github/workflows/ci-tests.yml
vendored
@@ -120,7 +120,7 @@ jobs:
|
|||||||
working-directory: data-env
|
working-directory: data-env
|
||||||
|
|
||||||
- name: Import special phrases
|
- name: Import special phrases
|
||||||
run: nominatim special-phrases --from-wiki | psql -d nominatim
|
run: nominatim special-phrases --import-from-wiki
|
||||||
working-directory: data-env
|
working-directory: data-env
|
||||||
|
|
||||||
- name: Check import
|
- 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)
|
[special key phrases](https://wiki.openstreetmap.org/wiki/Nominatim/Special_Phrases)
|
||||||
you also need to import these key phrases like this:
|
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
|
Note that this command downloads the phrases from the wiki link above. You
|
||||||
need internet access for the step.
|
need internet access for the step.
|
||||||
|
|||||||
@@ -7,5 +7,5 @@ require_once(CONST_LibDir.'/init-cmd.php');
|
|||||||
loadSettings(getcwd());
|
loadSettings(getcwd());
|
||||||
|
|
||||||
(new \Nominatim\Shell(getSetting('NOMINATIM_TOOL')))
|
(new \Nominatim\Shell(getSetting('NOMINATIM_TOOL')))
|
||||||
->addParams('import-special-phrases', '--from-wiki')
|
->addParams('special-phrases', '--import-from-wiki')
|
||||||
->run();
|
->run();
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ def nominatim(**kwargs):
|
|||||||
parser.add_subcommand('freeze', clicmd.SetupFreeze)
|
parser.add_subcommand('freeze', clicmd.SetupFreeze)
|
||||||
parser.add_subcommand('replication', clicmd.UpdateReplication)
|
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('add-data', UpdateAddData)
|
||||||
parser.add_subcommand('index', clicmd.UpdateIndex)
|
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
|
import logging
|
||||||
from nominatim.tools.special_phrases import SpecialPhrasesImporter
|
from nominatim.tools.special_phrases import SpecialPhrasesImporter
|
||||||
@@ -17,12 +17,12 @@ class ImportSpecialPhrases:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def add_args(parser):
|
def add_args(parser):
|
||||||
group = parser.add_argument_group('Input arguments')
|
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.')
|
help='Import special phrases from the OSM wiki to the database.')
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def run(args):
|
def run(args):
|
||||||
if args.from_wiki:
|
if args.import_from_wiki:
|
||||||
LOG.warning('Special phrases importation starting')
|
LOG.warning('Special phrases importation starting')
|
||||||
with connect(args.config.get_libpq_dsn()) as db_connection:
|
with connect(args.config.get_libpq_dsn()) as db_connection:
|
||||||
SpecialPhrasesImporter(
|
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):
|
def test_special_phrases_command(temp_db, mock_func_factory):
|
||||||
func = mock_func_factory(nominatim.clicmd.special_phrases.SpecialPhrasesImporter, 'import_from_wiki')
|
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
|
assert func.called == 1
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user