[OSM-dev] osmosis

Brett Henderson brett at bretth.com
Sat Oct 16 07:37:05 BST 2010


It looks like your input file contains duplicate nodes.  It is possible that
multiple versions of the same node exist.  This has come up a number of
times on the mailing list.

Does anybody have the list of steps for fixing this handy?

Brett

On Fri, Oct 15, 2010 at 3:21 AM, Jose Cid <doncid at gmail.com> wrote:

>  Hello All,
>
> I've been trying to import osm files (bz2) into postGres DB using osmosis
> (version 0.36 - built from svn). The command I used is the following:
>
> ./osmosis --read-xml-0.6 file="north_america.osm.bz2" --write-apidb-0.6
> populateCurrentTables=yes host="localhost" database="openstreetmap"
> user="osm" password="osm1" validateSchemaVersion=no
>
> The result being the following:
>
> SEVERE: Thread for task 1-read-xml-0.6 failed
> org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to bulk
> insert nodes into the database.
>         at
> org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.flushNodes(ApidbWriter.java:577)
>         at
> org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.process(ApidbWriter.java:1108)
>         at
> org.openstreetmap.osmosis.core.container.v0_6.NodeContainer.process(NodeContainer.java:58)
>         at
> org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.process(ApidbWriter.java:1082)
>         at
> org.openstreetmap.osmosis.xml.v0_6.impl.NodeElementProcessor.end(NodeElementProcessor.java:117)
>         at
> org.openstreetmap.osmosis.xml.v0_6.impl.OsmHandler.endElement(OsmHandler.java:107)
>         at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
> Source)
>         at
> org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
> Source)
>         at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
> Source)
>         at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> Source)
>         at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
>         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> Source)
>         at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
> Source)
>         at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
>         at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
>         at
> org.openstreetmap.osmosis.xml.v0_6.XmlReader.run(XmlReader.java:108)
>         at java.lang.Thread.run(Thread.java:636)
> Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value
> violates unique constraint "nodes_pkey"
>         at
> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
>         at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
>         at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
>         at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
>         at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
>         at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:321)
>         at
> org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.flushNodes(ApidbWriter.java:575)
>         ... 19 more
> Oct 14, 2010 12:14:21 PM org.openstreetmap.osmosis.core.Osmosis main
> SEVERE: Execution aborted.
> org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or more tasks
> failed.
>         at
> org.openstreetmap.osmosis.core.pipeline.common.Pipeline.waitForCompletion(Pipeline.java:146)
>         at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:92)
>         at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:616)
>         at
> org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
>         at
> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
>         at
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
>         at
> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:31)
>
> This has been the case for several other OSM files that I attempted to
> import.
>
> Has anyone run into the above issue?  Any solutions?
>
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20101016/97481f3d/attachment.html>


More information about the dev mailing list