My company is using the Nominatim in the production environment with the entire planet dataset. When we import the database the flatnode file was enable to reduce the importing time and storage use.

Now I tried to import custom POI, using osc file created by myself.

The POI in ".osc" file have negatives OSM ID. When I executed the command, to import osc file:

./update.php --import-diff teste.osc --index

I got this message:

Osm2pgsql failed due to ERROR: Flatnode store cannot save negative IDs.
ERROR: Error from osm2pgsql, 1

Error from osm2pgsql, 1

My question: What is the impact in the Nominatim queries if I remove the constant CONST_Osm2pgsql_Flatnode_File from my config file.

I thought of re-importing the database without flatnode. Is it worth it?

asked 11 Jul, 19:53

gnosis7's gravatar image

gnosis7
19116
accept rate: 0%


Importing the planet without a flatnode file is not recommended. It will be an order of magnitude slower.

However, you can try switching off the flatnode file after you have finished the planet import and before you update the database with your custom data. osm2pgsql should then use the Postgres database for storing the node information for your POIs and stop complaining about negative ids. In theory you should even be able to update the OSM data planet data with that method: switch on flatnodes when handling OSM osc, switch it off again when updating your own data.

If that really works in practise, I cannot say. It has never been tested to my knowledge. Nominatim might choke on negative OSM ids at some other point in the pipeline.

permanent link

answered 11 Jul, 20:43

lonvia's gravatar image

lonvia
4.9k14974
accept rate: 37%

Hi Lonvia, thank you for your time. My application (front-end iOS and Android) make requests to the Nominatim API several times for minutes and I do not know when the requests are performed and they can not stop. Can you tell me the impact on these requests by turning off the flatnodes, importing my data and then turning on the flatnodes? And If I turn off the flatnodes permanently on my current Nominatim API? What could happen? Grateful

(11 Jul, 22:18) gnosis7
1

The flatnode file is only used when importing or updating data. They are needed to compute the geometries, to be precise. Requests to your API are not affected at all if you switch them on and off.

(11 Jul, 22:26) lonvia

You helped me a lot. Thanks!

(12 Jul, 02:14) gnosis7

I had a similar requirement once, though relations, not nodes, and just one small country. It's possible to assign positive integers as long as they don't conflict with existing OSM ids. For example the current largest node id in OSM yesterday was 5,752,191,223. You could assign ids 100x, 1000x or 10000x times as high (depending how fast you believe OSM is growing). osm2pgsql supports 64bit integers and Nominatim's table schema uses BIGINT as well (https://www.postgresql.org/docs/9.6/static/datatype-numeric.html).

permanent link

answered 11 Jul, 22:05

mtmail's gravatar image

mtmail
1.8k434
accept rate: 24%

Thanks for your comment!

(12 Jul, 02:17) gnosis7
Your answer
toggle preview

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:

×503
×5
×2

question asked: 11 Jul, 19:53

question was seen: 150 times

last updated: 12 Jul, 02:17

powered by OSQA