Hi,

I've a local OSM server where I've imported a city extract. I need to import 
many small areas by converting geojson files to OSM XML first, and then import 
these files into the local OSM db to allow for map edits.

I'm assigning negative numbers to the ids. But when I import the data, the 
following duplicate key error is thrown:

duplicate key value violates unique constraint "current_nodes_pkey1"
  Detail: Key (id)=(1) already exists.

There is no id=1 in my data set. Therefore I don't know where to start looking 
at.

The import command is this:
osmosis --read-xml "$out_file" \
  --write-apidb host="localhost" database="openstreetmap" \
  user="$user" password="$pw" validateSchemaVersion="no"

I'm very new to OSM, so maybe I'm doing something wrong. 

Is this the right way to import data after the initial update is done? Where 
does the duplicate key error come from?

I've also dumped a small extract of my generated OSM XML file below.

Best
Ben

<osm version="0.6" generator="Geojson to OSM Site Importer">
<node id="-120000" lat="49.43864" lon="8.623447" changeset="1" version="1" 
timestamp="2016-06-11T22:37:45Z"><tag k="Text" v="Gastro"/><tag k="hdm_site_id" 
v="1"/></node>
...
<way id="-143048" changeset="1" version="1" 
timestamp="2016-06-11T22:37:45Z"><nd ref="-127583"/><nd ref="-127586"/><tag 
k="Linetype" v="Continuous"/><tag k="hdm_site_id" v="1"/></way>
...
</osm>
_______________________________________________
osmosis-dev mailing list
osmosis-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osmosis-dev

Reply via email to