Hi Brett, First of all thank you for answering!
The complete command line I’ve been using to start this process is: CALL "C:\Java\OSM\osmosis\v.0.43\bin\osmosis" -v --read-xml file="belgium-latest.osm.bz2" --log-progress interval=5 label=BELGIUM --write-pgsql host="xxxxxxxx" user="xxxx" database="xxxx" password="xxxxx" You’re quite right when addressing the “flag” for updating the pgsnapshot! I’m already reviewing the update process! So duplicates are certainly due to not using the update functionality! Regarding the merge of the files, this isn’t an option, for now, due to the incremental steps to my DB! This being said, I’m importing one country and afterwards another, repeating the process until I have the planet! Managing all the files and storage for everything is not an option at this point! I’m doing like this to produce a “proof of concept” on OSM data Best regards, Nuno From: Brett Henderson [mailto:br...@bretth.com] Sent: domingo, 13 de Outubro de 2013 12:02 Hi Nuno, On 10 October 2013 22:18, Nuno Miguel Lourenço <nuno-miguel-loure...@telecom.pt<mailto:nuno-miguel-loure...@telecom.pt>> wrote: Hi, I’m updating a OpenStreetMaps based DB, but we are doing incremental steps to the DB data. We are importing just a few countries and then proceed to continents and at the end the planet file. We are already using the country data! NOTE: The countries are not neighbors! We are importing some Europe countries from http://download.geofabrik.de/europe.html getting the several .osm.pbf files for the ones we want! We are coming across an issue… We are getting a lot of Detail: Key (id)=(xxxxx) is duplicated.; nested exception is org.postgresql.util.PSQLException: ERROR: could not create unique index "pk_relations" We are getting this for the relations table, for the nodes, ways tables also!!! It sounds like your .osm.pbf files contain duplicate data. The countries may not be neighbours, but there may still be data relationships that connect them. I assume (providing your exact command line and exception messages would be very helpful) you're trying to use a task like --write-pgsql which assumes that the database is empty. In your case you're trying to run it multiple times against a non-empty database which will fail if the input files contain duplicate data. Is there any way we can avoid this? Perhaps. Combining all .osm.pdf files together into a single file and remove duplicate data before importing should fix it. We tried to remove the duplicates on the osmosisUpdate function but it did not work due to this being called after all the pushes of data to the DB. The osmosisUpdate function is only called by the --write-pgsql-change task, but I don't believe you're using that task ... Is there any other way to do this with osmosis? Merge all the .osm.pbf files together before importing. Merging the several .osm.pbf files to generate a unique one is not a solution. Okay. Can you please explain why this is not an option? Brett
_______________________________________________ osmosis-dev mailing list osmosis-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/osmosis-dev