This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Loading data to APIdb

0

Im trying to upload 8GB osm file into API db, i truncated it before so its empty but as it appears its not. Postres throws error duplicated key. What is the best way to add new region to map, or how to clear data, so that configuration remains unchanged?

Here is my osmosis command: nohup osmosis --read-xml file.osm --write-apidb authFile=Auth.txt validateSchemaVersion=no 2> errorOutput.txt > output.txt &

asked 09 Jun '16, 15:53

jorax's gravatar image

jorax
26335
accept rate: 0%

Without seeing the data we can only speculate...

Assuming that the API db was really empty, maybe you're somehow trying to load the same thing twice?

(09 Jun '16, 19:51) SomeoneElse ♦

I downloaded 3 countries from geofabrik and merged them with osmosis. I dont think geofabrik files overlap with each other. Besides i used grep to scan for this duplicated id. It was found only once. I used --truncate-apidb before, but my guess is it doesnt work as it should. Is there any other way to append missing data? Somthing that will ignore duplicated data?

(09 Jun '16, 21:07) jorax

One Answer:

1

https://help.openstreetmap.org/questions/45930/osmosis-import-duplicate-key-value-violates-unique-constraint

outdated osmosis was the reason. Im using updated version right now. I'll post if this solved the problem but im pretty sure it will. Kinda sad that apt-get update doesn't work here, i had to install it manually.

EDIT: confirmed, remember always to use updated tools

answered 10 Jun '16, 09:18

jorax's gravatar image

jorax
26335
accept rate: 0%

edited 13 Jun '16, 11:30

Source code available on GitHub .