[osmosis-dev] Error when trying run Osmosis script
Paweł Paprota
ppawel at fastmail.fm
Thu Jan 15 11:33:07 UTC 2015
Hi Adityo,
I don't think that Osmosis can read the o5m format, at least not with
the --read-xml-change command - it expects the file to be in the
standard OSM XML format - so if you use the 674.osc, it should work.
Does it not?
Paweł
On Thu, Jan 15, 2015, at 11:21, Adityo Dwijananto wrote:
> Hi Pawel,
>
> So my command it's looks like this:
>
> sudo bin/osmosis --read-xml-change file="/home/adityo/osmchangeset/674.o5m" --write-pgsql-change user="osmuser" database="osm" password="osmuser"
>
> but i got another new error that the osmosis is unable to parse the xml file. I download the changeset from geofabrik and using gunzip to unpack the osc.gz file. After that i'm using command:
>
> osmconvert 674.osc --out-o5m > 674.o5m
>
> But i notice that i got different size file between 674.osc (which is 4,434 KiB) and 674.o5m (which is only 237 KiB).
>
> Is the error i got when i run osmosis is because i convert the .osc file with wrong command?
>
> Regards,
>
> Adityo
>
>> Jan 15, 2015 5:02:15 PM org.openstreetmap.osmosis.core.Osmosis run
>> INFO: Osmosis Version 0.43.1
>> Jan 15, 2015 5:02:15 PM org.java.plugin.registry.xml.ManifestParser <init>
>> INFO: got SAX parser factory - org.apache.xerces.jaxp.SAXParserFactoryImpl at 42ad08de
>> Jan 15, 2015 5:02:15 PM org.java.plugin.registry.xml.PluginRegistryImpl configure
>> INFO: configured, stopOnError=false, isValidating=true
>> Jan 15, 2015 5:02:15 PM org.java.plugin.registry.xml.PluginRegistryImpl register
>> INFO: plug-in and fragment descriptors registered - 1
>> Jan 15, 2015 5:02:15 PM org.java.plugin.standard.StandardPluginManager activatePlugin
>> INFO: plug-in started - org.openstreetmap.osmosis.core.plugin.Core at 0.0.0.42-6-gf39a160-dirty
>> Jan 15, 2015 5:02:15 PM org.openstreetmap.osmosis.core.Osmosis run
>> INFO: Preparing pipeline.
>> Jan 15, 2015 5:02:15 PM org.openstreetmap.osmosis.core.Osmosis run
>> INFO: Launching pipeline execution.
>> Jan 15, 2015 5:02:15 PM org.openstreetmap.osmosis.core.Osmosis run
>> INFO: Pipeline executing, waiting for completion.
>> Jan 15, 2015 5:02:15 PM org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskManager waitForCompletion
>> SEVERE: Thread for task 1-read-xml-change failed
>> org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to parse xml file /home/hotosm/osmchangeset/674.o5m. publicId=(null), systemId=(null), lineNumber=1, columnNumber=1.
>> at org.openstreetmap.osmosis.xml.v0_6.XmlChangeReader.run(XmlChangeReader.java:114)
>> at java.lang.Thread.run(Thread.java:745)
>> Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Invalid byte 1 of 1-byte UTF-8 sequence.
>> at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
>> at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
>> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
>> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
>> at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(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.XmlChangeReader.run(XmlChangeReader.java:109)
>> ... 1 more
>> Caused by: org.apache.xerces.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.
>> at org.apache.xerces.impl.io.UTF8Reader.invalidByte(Unknown Source)
>> at org.apache.xerces.impl.io.UTF8Reader.read(Unknown Source)
>> at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
>> at org.apache.xerces.impl.XMLEntityScanner.skipString(Unknown Source)
>> ... 10 more
>> Jan 15, 2015 5:02:15 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:606)
>> 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:47)
>
>
> *Adityo Dwijananto S. Si*
> **Humanitarian OpenStreetMap Team**
> Email*:*
> **_adityo.dwijananto at hotosm.org_**
> Phone:
> +62812 8654 7434
>
> On Thu, Jan 15, 2015 at 4:04 PM, Paweł Paprota <ppawel at fastmail.fm> wrote:
>> --read-xml-change produces changes so you need to use
>>
--write-pgsql-change not --write-pgsql to write them to the database.
>>
>>
Paweł
>>
>>
>>
On Thu, Jan 15, 2015, at 09:01, Adityo Dwijananto wrote:
>>
> Hi All,
>>
>
>>
> i'm trying to using osmosis to update my database with osm changeset. But when i try to run this script:
>>
>
>> > *~/osmosis-latest$ sudo bin/osmosis --read-xml-change file="~/osmchangeset/674.osm" --write-pgsql user="osmuser" database="osm" password="osmuser"*
>>
> **
>> > I got an error like this:
>>
>
>>
>> Jan 15, 2015 2:44:10 PM org.openstreetmap.osmosis.core.Osmosis run
>>
>> INFO: Osmosis Version 0.43.1
>>
>> Jan 15, 2015 2:44:10 PM org.java.plugin.registry.xml.ManifestParser <init>
>>
>> INFO: got SAX parser factory - org.apache.xerces.jaxp.SAXParserFactoryImpl at 4b40de18
>>
>> Jan 15, 2015 2:44:10 PM org.java.plugin.registry.xml.PluginRegistryImpl configure
>>
>> INFO: configured, stopOnError=false, isValidating=true
>>
>> Jan 15, 2015 2:44:11 PM org.java.plugin.registry.xml.PluginRegistryImpl register
>>
>> INFO: plug-in and fragment descriptors registered - 1
>>
>> Jan 15, 2015 2:44:11 PM org.java.plugin.standard.StandardPluginManager activatePlugin
>>
>> INFO: plug-in started - org.openstreetmap.osmosis.core.plugin.Core at 0.0.0.42-6-gf39a160-dirty
>>
>> Jan 15, 2015 2:44:11 PM org.openstreetmap.osmosis.core.Osmosis run
>>
>> INFO: Preparing pipeline.
>>
>> Jan 15, 2015 2:44:11 PM org.openstreetmap.osmosis.core.Osmosis main
>>
>> SEVERE: Execution aborted.
>>
>> org.openstreetmap.osmosis.core.OsmosisRuntimeException: Task 2-write-pgsql does not support data provided by default pipe stored at level 1 in the default pipe stack.
>>
>> at org.openstreetmap.osmosis.core.pipeline.common.PipeTasks.retrieveTask(PipeTasks.java:157)
>>
>> at org.openstreetmap.osmosis.core.pipeline.common.TaskManager.getInputTask(TaskManager.java:165)
>>
>> at org.openstreetmap.osmosis.core.pipeline.v0_6.SinkManager.connect(SinkManager.java:50)
>>
>> at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.connectTasks(Pipeline.java:74)
>>
>> at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.prepare(Pipeline.java:116)
>>
>> at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:86)
>>
>> 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:606)
>>
>> 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:47)
>>
>
>>
> I'm using Ubuntu 14.04 server with Postgres 9.3 and postgis 2.1.2. I tried to use both simple schema and snapshot schema but it's always got an error like i mention above. Can someone help me? Thanks
>>
>
>>
> Regards,
>>
>
>>
> Adityo
>> > _________________________________________________
>>
> osmosis-dev mailing list
>>
> osmosis-dev at openstreetmap.org
>>
> https://lists.openstreetmap.org/listinfo/osmosis-dev
>>
>>
_______________________________________________
>>
osmosis-dev mailing list
>> osmosis-dev at openstreetmap.org
>> https://lists.openstreetmap.org/listinfo/osmosis-dev
>
More information about the osmosis-dev
mailing list