This is a well known issue and one that is likely not going to be addressed any time soon.

While the rendering tables allow multiple geometries per osm feature / id and therefore don't have a unique constraint on osm_id, the slim tables are used for update processing and thus need to do lookups based on osm_id, for which it has to be unique.

For performance reasons osm2pgsql uses the COPY command, that batches up inserts into a single command. As such, if there is a unique constraint (or duplicate Key) violation, the whole batch fails. As osm2pgsql does stream based processing, it does not have the ability to go back and reprocess that batch of nodes / ways / relations to properly deal with the duplicate entry. Therefore, it cannot recover from such a duplicate key failure and terminates.

Osm2pgsql therefore doesn't support importing multiple files into one database in slim mode if there are duplicate osm features. Instead, I would recommend merging the two files prior to importing with osm2pgsql. For example with osmosis that supports de-duplication on merge.

参考: https://github.com/openstreetmap/osm2pgsql/issues/16#event-165848217

osm2pgsql导入duplicate key error in slim mode的更多相关文章

  1. E11000 duplicate key error index

    E11000 duplicate key error index mongodb插入报错,重复主键问题,有唯一键值重复 一般使用collection.insertOne(doc);插入一条已存在主键的 ...

  2. mongodb E11000 duplicate key error collection: index: _id_ dup key

    今天在单测的时候,出现这个问题. 我代码只定义了一个变量 let body = {name: 'wu'} 然后连续2次插入这个body数据 await exam.insertExam(body); a ...

  3. E11000 duplicate key error index: test.collection.$a.b_1 dup key: { : null } 报错记录

    这个一般分为两种情况,第一新增数据出现约束.而你在orm里面写了唯一约束.这种情况就比较简单,添加数据时保证数据字段唯一性就好了. 第二种情况比较难找,因为你发现你在orm里面并没有写约束,但是还是插 ...

  4. mysql archive存储引擎导入数据报duplicate key

    DROP TABLE IF EXISTS `test`;CREATE TABLE `test` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `ve ...

  5. Error: Duplicate key name 'PCS_STATS_IDX' (state=42000,code=1061) ----Hive schematool -initSchema -dbType mysql

    schematool -initSchema -dbType mysqlMetastore connection URL: jdbc:mysql://localhost/metastore_db?cr ...

  6. Error: Duplicate key name 'PCS_STATS_IDX' (state=42000,code=1061)

    以下异常说明mysql已经启动. 应先关掉先前启动的mysql.再执行初始化schema操作. $service mysql stop; # $HIVE_HOME/bin/schematool -db ...

  7. mysql 之SQL语句--NSERT SELECT ON DUPLICATE KEY UPDATE的写法

    Table source CREATE TABLE `source` ( `key` int(11) NOT NULL AUTO_INCREMENT, `data` int(11) DEFAULT N ...

  8. [BTS]The join order has been enforced because a local join hint is used.;Duplicate key was ignored.".

    在一个客户的BizTalk Server 2013 R2环境中会报如下的ERROR,查找相关资料后,先试试停掉所有Trace. Log Name:      ApplicationSource:    ...

  9. INSERT ... ON DUPLICATE KEY UPDATE Syntax

    一 mybatis中返回自动生成的id 当有时我们插入一条数据时,由于id很可能是自动生成的,如果我们想要返回这条刚插入的id怎么办呢.在mysql数据中我们可以在insert下添加一个selectK ...

随机推荐

  1. Oracle临时表和SQL Server临时表的不同点对比

    文章来源:http://www.codesky.net/article/201109/141401.html 1.简介 Oracle数据库除了可以保存永久表外,还可以建立临时表temporary ta ...

  2. 【4】JDK和CGLIB生成动态代理类的区别

    当一个对象(客户端)不能或者不想直接引用另一个对象(目标对象),这时可以应用代理模式在这两者之间构建一个桥梁--代理对象. 按照代理对象的创建时期不同,可以分为两种: 静态代理:事先写好代理对象类,在 ...

  3. rpm 软件包离线安装

    1. 插件安装(可选) yum install yum-plugin-downloadonly 2. 只下载不安装(perl 演示) yum install --downloadonly --down ...

  4. 解决ubantu中sublime不支持中文的方法

    更新然后将系统升级到最新版本,在linux终端输入 sudo apt-get update && sudo apt-get 在本地目录中克隆此repo:    如果你没有git的话就安 ...

  5. aspupload ,在winows server 2008 下无法使用

    aspupload ,在winows server 2008 下无法使用.求助解决办法 2014-01-12 13:31 goolean | 浏览 775 次 操作系统 aspupload64位,安装 ...

  6. substr的学习(PHP学习)

    substr的用法: 首先看PHP手册 ,手册上是这样说的 string substr ( string $string , int $start [, int $length ] ) 执行subst ...

  7. 整数a整数b

    namespace ConsoleApplication6{ class Program { static void Main(string[] args) { while (true) { Cons ...

  8. AngularJS:教程

    ylbtech-AngularJS:教程 1.返回顶部 1. AngularJS 教程 AngularJS 通过新的属性和表达式扩展了 HTML. AngularJS 可以构建一个单一页面应用程序(S ...

  9. js中的Math

    js中的Math Math.round 取最接近的整数 Math.round(-2.7) // -3 Math.ceil 向上取整 Math.ceil(1.1) // 2 Math.floor 向下取 ...

  10. Python中常用模块一

    random模块 import random # 应用数学计算 print(random.random()) # 取随机小数 范围是 0-1之间 # 应用抽奖 , 彩票 print(random.ra ...