NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

When i use osmosis command to import data into the openstreetmap database, some error appears, such as duplicate key value violates unique constraint "relations_pkey". The command that i used is ./osmosis-latest/bin/osmosis --read-pbf file="planet/chengdu_china.osm.pbf" --write-apidb host="localhost" database="openstreetmap" user="osm" password="buaanlp" validateSchemaVersion=no. I have used the lastest osmosis tool and the version of osmosis is 0.45, but the problem still arise, how can i sovle this problem?

If this problem can't be solved, then how can i add .pdf data file into the apidb?

asked 12 Sep '16, 05:15

yuyy's gravatar image

yuyy
236222431
accept rate: 20%


The key to the answer is in your last sentence: you are adding data to an existing datanase, which already contains an entry for the objects in question.

AFAIK you cannot directly merge into an existing APIDB with osmosis, you can however merge two datasources into one, see --merge. With other words you should pre-merge and then import (if you have modified data in your APIDB likely export, merge, re-import).

permanent link

answered 12 Sep '16, 11:49

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

Ok,thanks to your reply, so the osmosis command only can use once when import .pbf data file because the apidb must keep empty, this is so unconvenient and unreasonable.

(12 Sep '16, 12:44) yuyy
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:

×252
×165
×29

question asked: 12 Sep '16, 05:15

question was seen: 2,473 times

last updated: 12 Sep '16, 12:44

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum