Hello everyone,

I had successfully installed openstreetmap-website on Ubuntu 14.04. Now I'am trying to import a pbf file into the "openstreetmap" database using the following command:

osmosis --read-pbf /home/osm-data/my_citie.osm.pbf --write-apidb host="localhost" database="openstreetmap" user="postgres" password="*********" validateSchemaVersion="no

but I still get this error:

org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "current_nodes_pkey1"

Note: Osmosis Version is 0.40.1
I installed it with "sudo apt-get install osmosis"
PBF file downloded from Mapzen Metro Extracts
PostgreSQL version is 9.3

I need your help please

asked 16 Oct '15, 09:04

AYARI's gravatar image

accept rate: 0%

edited 16 Oct '15, 09:15

Does the full error message state which key is duplicated?

(16 Oct '15, 09:59) scai ♦

Yes, this is the full message :

Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "nodes_pkey" Détail : Key (node_id, version)=(27564968, 67) already exists.
(16 Oct '15, 10:09) AYARI

Maybe the extract is broken, you could try a different extract. And/or a newer osmosis version (the latest version is 0.44.1) but a duplicated key or a duplicated node sounds weird.

(16 Oct '15, 10:36) scai ♦

I tried with another extract from geofabrik, but I always get the same error.

How can I install the latest osmosis version ?? apt-get always install 0.40.1

(16 Oct '15, 11:16) AYARI

You have to download it yourself, unpack it and run it via ./osmosis-latest/bin/osmosis (or whatever path you extracted it to).

(16 Oct '15, 11:28) scai ♦

As an aside, it might be worth adding (or asking in another question) what you're planning to use a copy of the OSM website with Tunis data in it for - there might be an easier way to achieve what you're trying to do by some other method.

(16 Oct '15, 11:45) SomeoneElse ♦

finally solved

I used the latest version of osmosis (0.44.1) and a ".bz2" osm file that I downloaded from geofabrik, now the import goes without any error.

But I still do not understand the issue

(16 Oct '15, 14:11) AYARI

SomeoneElse :

I'am using Tunis data just for test, but I'am working on the whole planet database for map rendering, geocoding and routing..

(16 Oct '15, 14:23) AYARI

If you're interested in rendering, geocoding and routing, then an APIDB may not be the way to go. For rendering in the same way as osm.org, see https://switch2osm.org/serving-tiles/ (though other renderers are available), for geocoding see http://wiki.openstreetmap.org/wiki/Nominatim/Installation (again, other geocoders exist), for routing perhaps some of the examples from http://wiki.openstreetmap.org/wiki/Routing#Developers .

(16 Oct '15, 14:41) SomeoneElse ♦

According to changes.txt version 0.44.1 fixed an issue with "duplicate way nodes in pgsnapshot module" which could be the reason for your error. Or one of the many other fixes between version 0.40.1 and 0.44.1.

(16 Oct '15, 16:20) scai ♦
showing 5 of 10 show 5 more comments
Be the first one to answer this question!
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: 16 Oct '15, 09:04

question was seen: 2,706 times

last updated: 16 Oct '15, 16:20

powered by OSQA