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:
I got this message:
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 '18, 19:53 gnosis7 |
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. answered 11 Jul '18, 20:43 lonvia 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 '18, 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 '18, 22:26)
lonvia
You helped me a lot. Thanks!
(12 Jul '18, 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). answered 11 Jul '18, 22:05 mtmail Thanks for your comment!
(12 Jul '18, 02:17)
gnosis7
|