Hi,
This is definitely an OSM specific question but because I know the answer I will tell you. Or better if you read it yourself
http://forum.openstreetmap.org/viewtopic.php?id=23765
Best place for your question would have been https://help.openstreetmap.org/ and OSM forum is suitable too even it is not so popular.
But it may also be some other problem coming from that you have osm2pgsql SVN version 0.70.5. It is far too old. Meanwhile OSM has started to use 64-bit IDs and it may be that your old osm2pgsql from the 32-bit era can interpret that some ID with 64-bit integer value is the same as some other ID that is small enough to be presented as 32-bit integer. Anyway, sooner or later you will meet the same pkey values coming from different OSM files and you must learn to merge.
-Jukka Rahkonen-
tt5430 wrote:
Hi,
I post my question here but not sure if this is the right group since I could not
find any group specific for osm2pgsql problem. I am trying the append new osm
dataset to my PostGis database and keep getting duplicate key value violation
error even though the osm data are from different part of the country. For
example:First, I imported California, USA using the following command:
osm2pgsql -U postgres -m -s -K -d osm -p osm -E 3857 -S default.style
california-latest.osm.bz2then imported Rhode Island using this command:
osm2pgsql -U postgres -m -s -K -a -d osm -p osm -E 3857 -S default.style
rhode-island-latest.osm.bz2Here is the screen capture of the command output:
osm2pgsql SVN version 0.70.5Using projection SRS 3857 (EPSG:3857)
Setting up table: osm_point
NOTICE: table "osm_point_tmp" does not exist, skipping Setting up table:
osm_line
NOTICE: table "osm_line_tmp" does not exist, skipping Setting up table:
osm_polygon
NOTICE: table "osm_polygon_tmp" does not exist, skipping Setting up table:
osm_roads
NOTICE: table "osm_roads_tmp" does not exist, skipping
Mid: pgsql, scale=100, cache=800MB, maxblocks=102401*8192 Setting up table:
osm_nodes
*** WARNING: intarray contrib module not installed
*** The resulting database will not be usable for applying diffs.
Setting up table: osm_ways
Setting up table: osm_relsReading in file: rhode-island-latest.osm.bz2
Processing: Node(673k) Way(69k) Relation(300) parse time: 91sNode stats: total(673452), max(2144239393) Way stats: total(69015),
max(258361546) Relation stats: total(300), max(3403421)Going over pending ways
processing way (0k)COPY_END for COPY osm_rels FROM STDIN;
failed: ERROR: duplicate key value violates unique constraint "osm_rels_pkey"
DETAIL: Key (id)=(148838) already exists.
CONTEXT: COPY osm_rels, line 25: "148838 2 432
{158368533,424317935,42299022,42299024,42298793,240353468,240353467,
42298798,42298795,2..."In fact, I have tried the above steps with different dataset such as:
(Alabama, Rhode Island), (Alabama, New Hamshire), etc. and all of them ended
up with same errors.Am I doing anything wrong here or osm2pgsql could not be used to append new
data to PostGis database?
Is there any work around or better way to do this? Also, will this problem also
occurs in differential update of the planet_osm database?Many thanks in advance.
Regards,
Tam--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Fail-to-
append-new-OSM-data-to-PostGIS-using-osm2pgsql-tp5102135.html
Sent from the GeoServer - User mailing list archive at Nabble.com.------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications Take advantage of
what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktr
k
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users