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. Spring中的c3p0配置

    转载请注明出处:http://blog.csdn.net/l1028386804/article/details/51162560 今天,我们就来详细谈谈Spring中的c3p0配置问题,好了,不耽搁 ...

  2. Java关闭线程的安全方法

    Java之前有一个api方法可以直接关闭线程,stop(),由于这个方法是强制性地关闭线程,有的时候会发生错误,之后就取消了,现在可用的方法主要有两种: 1.  在线程中加入一个成员变量,当一个fla ...

  3. 剑指offer-第七章面试案例1(字符串转换为整型)

    //将字符串转换为整型 //思路:特殊的输入测试: //1,考虑字符串是否为空.2.字符串问空的时候的返回0,和真实的返回0直键的区别.3,字符串中出现0~9的字符处理 //4.字符串中出现*,¥等一 ...

  4. gatsbyjs 使用

    1. 安装 npm install --global gatsby-cli 2. 使用 // 创建项目 gatsby new dalong cd dalong // 启动 gatsby develop ...

  5. bzoj 1415 [Noi2005]聪聪和可可——其实无环的图上概率

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1415 乍一看和“游走”一样.于是高斯消元.n^2状态,复杂度n^6…… 看看TJ,发现因为聪 ...

  6. FIREDAC的心得

    FIREDAC与UNIDAC有些不同 但大体上是相同的 以下是一些随手笔记: FieldCount是当前FDQuery2所在行里面有多少列 一般用FieldList[X]来代表第几列 str:=FDQ ...

  7. Python学习书籍推荐 中英对照

    Learn Python The Hard Way 笨办法学 python A Byte of Python 简明Python教程 初学者 英文版 Learning Python, 3rd Editi ...

  8. webservice有关application/xop+xml的异常

    今天同事调用一个webservice时返回类似错误 响应消息的内容类型 multipart/related; type="application/xop+xml"; boundar ...

  9. juc原子类之二:基本类型原子类AtomicInteger(AtomicLong、AtomicBoolean)

    一.AtomicInteger简介 AtomicInteger, AtomicLong和AtomicBoolean这3个基本类型的原子类的原理和用法相似.以AtomicInteger对基本类型的原子类 ...

  10. phpmailer实现邮件发送

    phpmailer实现邮件发送 1.代码 <?php require("class.phpmailer.php"); //这个是一个smtp的php文档,网上可以下载得到 $ ...