NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

We are using PostgreSQL (with postgis)! The below are the extensions I added to the database

CREATE EXTENSION hstore;
osmosis/script/pgsnapshot_schema_0.6.sql
osmosis/script/pgsnapshot_schema_0.6_action.sql
pgsnapshot_schema_0.6_linestring.sql

When I execute the below command,

osmosis --read-xml file="map.osm" --write-pgsql host="localhost:5432" database="mymap" user="postgres" password="1234"

I am getting this error

Jul 31, 2013 2:44:44 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.40.1
Jul 31, 2013 2:44:44 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Jul 31, 2013 2:44:44 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
Jul 31, 2013 2:44:44 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
log4j:WARN No appenders could be found for logger (org.springframework.jdbc.datasource.DataSourceUtils).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Jul 31, 2013 2:44:45 PM org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskManager waitForCompletion
SEVERE: Thread for task 1-read-xml failed
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Cannot begin reading in Add stage, must call complete first.
    at org.openstreetmap.osmosis.core.store.RandomAccessObjectStore.initializeReadingStage(RandomAccessObjectStore.java:156)
    at org.openstreetmap.osmosis.core.store.RandomAccessObjectStore.createReader(RandomAccessObjectStore.java:181)
    at org.openstreetmap.osmosis.core.store.IndexStore.createReader(IndexStore.java:151)
    at org.openstreetmap.osmosis.core.store.IndexedObjectStore.createReader(IndexedObjectStore.java:96)
    at org.openstreetmap.osmosis.pgsnapshot.common.CompactPersistentNodeLocationStore.getNodeLocation(CompactPersistentNodeLocationStore.java:50)
    at org.openstreetmap.osmosis.pgsnapshot.v0_6.impl.WayGeometryBuilder.createWayLinestring(WayGeometryBuilder.java:204)
    at org.openstreetmap.osmosis.pgsnapshot.v0_6.impl.CopyFilesetBuilder.process(CopyFilesetBuilder.java:190)
    at org.openstreetmap.osmosis.core.container.v0_6.WayContainer.process(WayContainer.java:60)
    at org.openstreetmap.osmosis.pgsnapshot.v0_6.impl.CopyFilesetBuilder.process(CopyFilesetBuilder.java:115)
    at org.openstreetmap.osmosis.pgsnapshot.v0_6.PostgreSqlCopyWriter.process(PostgreSqlCopyWriter.java:95)
    at org.openstreetmap.osmosis.xml.v0_6.impl.WayElementProcessor.end(WayElementProcessor.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.impl.XMLDocumentFragmentScannerImpl.scanEndElement(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:189)
    at org.openstreetmap.osmosis.xml.v0_6.XmlReader.run(XmlReader.java:108)
    at java.lang.Thread.run(Thread.java:722)

Jul 31, 2013 2:44:45 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:601)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:328)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:408)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:351)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:31)

Can anyone let me know how to fix it?

Thanks

asked 31 Jul '13, 14:08

iamlol's gravatar image

iamlol
1111
accept rate: 0%

edited 31 Jul '13, 19:05

gormo's gravatar image

gormo
2.9k32660


It looks like the problem is with reading the XML file and is unrelated to PostgreSQL. What version of osmosis do you have, and does the --fast-read-xml command work?

permanent link

answered 31 Jul '13, 23:16

pnorman's gravatar image

pnorman
2.4k52140
accept rate: 18%

Its not working.. I am using Latest stable version

(01 Aug '13, 09:28) iamlol

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×252
×165
×134

question asked: 31 Jul '13, 14:08

question was seen: 5,625 times

last updated: 01 Aug '13, 09:28

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum