mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
Merge pull request #3410 from lonvia/docs-special-phrases
Add documentation of the format for special phrases CSV
This commit is contained in:
@@ -11,16 +11,31 @@ nominatim special-phrases --import-from-wiki
|
|||||||
|
|
||||||
## Importing custom special phrases
|
## Importing custom special phrases
|
||||||
|
|
||||||
But, it is also possible to import some phrases from a csv file.
|
Special phrases may also be imported from any custom CSV file. The file needs
|
||||||
To do so, you have access to the following command:
|
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
|
```sh
|
||||||
nominatim special-phrases --import-from-csv <csv file>
|
nominatim special-phrases --import-from-csv <csv file>
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that the two previous import commands will update the phrases from your database.
|
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
|
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
|
present in the CSV file will be kept into the database. All other phrases will
|
||||||
be removed.
|
be removed.
|
||||||
|
|
||||||
If you want to only add new phrases and not update the other ones you can add
|
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 <csv file> --no-replace
|
nominatim special-phrases --import-from-csv <csv file> --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.
|
removing the other ones.
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ You should have set up this directory as part of the Nominatim import.
|
|||||||
Any configuration found in the `.env` file in this directory will automatically
|
Any configuration found in the `.env` file in this directory will automatically
|
||||||
used.
|
used.
|
||||||
|
|
||||||
Yo may also configure Nominatim be setting environment variables.
|
You may also configure Nominatim by setting environment variables.
|
||||||
Normally, Nominatim will check the operating system environment. This can be
|
Normally, Nominatim will check the operating system environment. This can be
|
||||||
overwritten by giving the constructor a dictionary of configuration parameters.
|
overwritten by giving the constructor a dictionary of configuration parameters.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user