NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I have set up my local Nominatim instance using the mediagis/nominatim:4.0 Docker image and so far so good, it works like a charm. Now, I would like to know if it is possible to add some custom place to the Nominatim database and have them considered in search, lookup, etc. By digging a bit into the Nominatim documentation and source code, it seems to me that it should be possible by adding a custom row to the placex table with indexed_status != 0. It looks like there is also the possibility of using "osm_type = X" for e"X"ternal sources. So I ask: will just adding a row to the placex table trigger everything is needed to have that custom place considered in the various Nominatim functionalities? And, in case, what are the columns to be filled for that to work? Thanks

asked 09 Mar '22, 10:36

todelo's gravatar image

todelo
11113
accept rate: 0%


The e"X"ternal data feature is a piece of very old unmaintained code that likely won't really do what you want. Most importantly, it won't add your data to the search tables, so you can't really find it.

The easiest way to add custom data to Nominatim is to convert your data into OSM format and then add it with nominatim add-data --file <custom.xml> followed by an indexing nominatim index. Make sure to use OSM IDs that are not yet in the database. This way you can be sure that address computation and building of the search index are handled just as for any other data.

permanent link

answered 10 Mar '22, 07:51

lonvia's gravatar image

lonvia
6.2k25789
accept rate: 40%

Then Nominatim interprets it as an update and replaces your data.

(10 Mar '22, 09:08) lonvia

Indeed. Is there a way to prevent this? Is a meaningful OSM_ID really needed for search and lookup?

(10 Mar '22, 09:18) todelo

I see. But what happens if I update my database with an extract of the updated OSM data and the OSM_IDs I've chosen get duplicated?

permanent link

answered 10 Mar '22, 09:00

todelo's gravatar image

todelo
11113
accept rate: 0%

edited 10 Mar '22, 09:01

After a few months not working on the problem I tried Ionvia's solution, but something did not work. I created an xml file from a DataFrame with pyosmium. The file looks like this:

alt text

I run nominatim add-data --file <myfile.xml> and the nodes indeed appear in the planet_osm_nodes table. However, the command nominatim index runs with no errors but indexes 0/0 new objects at every rank level. And indeed the new nodes do not eventually appear in the placex table and therefore do not show up in the search.

What am I missing?

permanent link

answered 10 May '22, 16:35

todelo's gravatar image

todelo
11113
accept rate: 0%

edited 10 May '22, 16:37

1

It's addr:housenumber not addr:house_number.

(10 May '22, 16:55) lonvia

Oh dear! Thank you so much!

(10 May '22, 21:37) todelo

Hi @todelo I need to edit the column 'extratags' in the table 'placex'. I have installed Nominatim in my local machine. Its possible to make this changes in the database?

Could you help me with this?

Thank you.

permanent link

answered 01 Mar '23, 15:32

Martim's gravatar image

Martim
1
accept rate: 0%

Hi @todelo I need to edit the column 'extratags' in the table 'placex'. I have installed Nominatim in my local machine. Its possible to make this changes in the database?

Could you help me with this?

Thank you.

permanent link

answered 01 Mar '23, 15:32

Martim's gravatar image

Martim
1
accept rate: 0%

What do you mean exactly? If you have your local installation, that means you have a local postgreSQL database, so you can modify the extratags column with standard SQL commands. I am not sure what happens to your changes if you update your data though

permanent link

answered 02 Mar '23, 09:18

todelo's gravatar image

todelo
11113
accept rate: 0%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×689
×39

question asked: 09 Mar '22, 10:36

question was seen: 2,852 times

last updated: 02 Mar '23, 09:18

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum