2010/1/21 Jon Burgess <jburgess...@googlemail.com>:
> On Thu, 2010-01-21 at 11:13 -0500, Jason Beverage wrote:
>> I'm working with osm2pgsql (latest trunk version) to import OSM into a
>> PostgreSQL/PostGIS database.  The issue I'm having is that if I use
>> the --slim option I'll occasionally get an error similar to:
>>
>> Going over pending relations
>> COPY_END for COPY osm_rels FROM STDIN;
>>  failed: ERROR:  duplicate key value violates unique constraint
>> "osm_rels_pkey"
>> CONTEXT:  COPY osm_rels, line 1207: "284132    0    323
>> {42198453,20559277,20559273,20558263,20494565,40702583,19846737,19826462,20582455,20585..."
>>
>> If I don't use slim mode, it seems to always work.  Right now I'm just
>> testing with state snapshots from http://downloads.cloudmade.com/, but
>> I'd like to be able to import the whole OSM planet database and I'd
>> really like to be able to use slim mode so I can do incremental
>> updates and reduce the memory requirements for importing.
>
> If I remember correctly this error occurs when you try to import two
> data sets which contain some overlapping data. In your case it appears
> that relation ID 284132 appears in both the data extracts. Only the slim
> mode keeps a copy of this node/way/relation data and triggers this
> error.
>
> It is not clear what the code should do in this case. It is possible
> that some of the data from the original object might have been removed
> when the extract was created because it fell outside the bounding box so
> neither of the extracts have the complete information. This issue is
> probably easier to understand if you consider what might happen to the
> way representing a road crossing the border between two countries.
>
> The only obvious solution is to either manually fix up the overlapping
> data or obtain an extract with all the data you want in a single file.

Or, merge the way JOSM merges freshly downloaded data with your
existing layer.  This would assume the extracts are created with the
option that keeps the full ways /relations if only one node is inside
the area, like the map API call does.

Cheers,
Andrew

_______________________________________________
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev

Reply via email to