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, 10:36

todelo's gravatar image

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, 07:51

lonvia's gravatar image

accept rate: 39%

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

(10 Mar, 09:08) lonvia

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

(10 Mar, 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, 09:00

todelo's gravatar image

accept rate: 0%

edited 10 Mar, 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, 16:35

todelo's gravatar image

accept rate: 0%

edited 10 May, 16:37


It's addr:housenumber not addr:house_number.

(10 May, 16:55) lonvia

Oh dear! Thank you so much!

(10 May, 21:37) todelo
Your answer
toggle preview

Follow this question

By Email:

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



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:


question asked: 09 Mar, 10:36

question was seen: 598 times

last updated: 10 May, 21:37

powered by OSQA