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
[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.
loadSettings(getcwd());
(new \Nominatim\Shell(getSetting('NOMINATIM_TOOL')))
- ->addParams('import-special-phrases', '--from-wiki')
+ ->addParams('special-phrases', '--import-from-wiki')
->run();
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)
"""
- Implementation of the 'import-special-phrases' command.
+ Implementation of the 'special-phrases' command.
"""
import logging
from nominatim.tools.special_phrases import SpecialPhrasesImporter
@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(
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
= array(
'highway' => array('bus_stop', 'rest_area', 'raceway'),
'building' => array(),
- );
\ No newline at end of file
+ );