From: Sarah Hoffmann Date: Sun, 5 May 2024 07:59:32 +0000 (+0200) Subject: add documentation of special phrases CSV format X-Git-Tag: deploy~7^2~3^2~1 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/cf2697f8f4c208cc3e1c15f7d8ce3cb715dc97ca?ds=inline add documentation of special phrases CSV format --- diff --git a/docs/customize/Special-Phrases.md b/docs/customize/Special-Phrases.md index f6f73442..52a31a8e 100644 --- a/docs/customize/Special-Phrases.md +++ b/docs/customize/Special-Phrases.md @@ -11,16 +11,31 @@ nominatim special-phrases --import-from-wiki ## Importing custom special phrases -But, it is also possible to import some phrases from a csv file. -To do so, you have access to the following command: +Special phrases may also be imported from any custom CSV file. The file needs +to have a header line, use comma as delimiter and define the following +columns: + + * **phrase**: the keyword to look for + * **class**: key of the main tag of the place to find + (see [principal tags in import style](../Import-Styles.md#set_main_tags-principal-tags) + * **type**: value of the main tag + * **operator**: type of special phrase, may be one of: + * *in*: place is within the place defined by the search term (e.g. "_Hotels in_ Berlin") + * *near*: place is near the place defined by the search term (e.g. "_bus stops near_ Big Ben") + * *named*: special phrase is a classifier (e.g. "_hotel_ California") + * *-*: unspecified, can be any of the above + +If the file contains any other columns, then they are silently ignored + +To import the CSV file, use the following command: ```sh nominatim special-phrases --import-from-csv ``` Note that the two previous import commands will update the phrases from your database. -This means that if you import some phrases from a csv file, only the phrases -present in the csv file will be kept into the database. All other phrases will +This means that if you import some phrases from a CSV file, only the phrases +present in the CSV file will be kept into the database. All other phrases will be removed. If you want to only add new phrases and not update the other ones you can add @@ -30,5 +45,5 @@ the argument `--no-replace` to the import command. For example: nominatim special-phrases --import-from-csv --no-replace ``` -This will add the phrases present in the csv file into the database without +This will add the phrases present in the CSV file into the database without removing the other ones.