[osmosis-dev] Merge multiple files
Jaromír Mikeš
mira.mikes at seznam.cz
Thu Oct 24 20:56:44 UTC 2013
Od: Brett Henderson <brett at bretth.com>
"
Hi Mira,
On 28 September 2013 21:16, Jaromír Mikeš <mira.mikes at seznam.cz
(mailto:mira.mikes at seznam.cz)> wrote:
"
I know that I can merge multiple files this way:
osmosis --rx 1.osm --rx 2.osm --rx 3.osm --merge --merge --wx merged.osm
But this way is not very useful if you need merge 200+ files.
Would possible implement something like this?
osmosis --rx my/files/* --merge --wx merged.osm
"
It would require significant changes to the way Osmosis works. With some
effort, a new --rx task could perhaps be created to write read multiple XML
files and write them to separate pipes, but a new --merge task would have no
way of knowing how many inputs it should consume.
It's not something I'll personally be tackling. Can this be solved with a
wrapper shell script?
"
Hi,
people on linuxquestions.com helped me with script:
----------
#!/bin/bash
args=()
for osm in "$@" ; do
args+=(--rx "$osm")
done
for ((i=0; i < $#-1; i++)) ; do
args+=(--merge)
done
args+=(--wx merged.osm)
osmosis "${args[@]}"
------------*
but I still can't merge files because of this error:
------------------------------
$ osmosis --rx 1.osm --rx 2.osm --rx 3.osm --merge --merge --wx merged.osm
Oct 24, 2013 10:47:32 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.40.1
Oct 24, 2013 10:47:32 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Oct 24, 2013 10:47:32 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
Oct 24, 2013 10:47:32 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
Oct 24, 2013 10:47:32 PM org.openstreetmap.osmosis.core.pipeline.common.
ActiveTaskManager waitForCompletion
SEVERE: Thread for task 1-rx failed
org.openstreetmap.osmosis.core.OsmosisRuntimeException: The entity timestamp
attribute is missing.
at org.openstreetmap.osmosis.core.domain.common.
UnparsedTimestampContainer.<init>(UnparsedTimestampContainer.java:34)
at org.openstreetmap.osmosis.xml.common.BaseElementProcessor.
createTimestampContainer(BaseElementProcessor.java:90)
at org.openstreetmap.osmosis.xml.v0_6.impl.NodeElementProcessor.begin
(NodeElementProcessor.java:79)
at org.openstreetmap.osmosis.xml.v0_6.impl.OsmHandler.startElement
(OsmHandler.java:90)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(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:189)
at org.openstreetmap.osmosis.xml.v0_6.XmlReader.run(XmlReader.java:108)
at java.lang.Thread.run(Thread.java:724)
etc.
-----------------------
I am trying merge osm files created by phyghtmap tool.
Any help with this failure?
thank you
mira
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/osmosis-dev/attachments/20131024/2cc493e3/attachment.html>
More information about the osmosis-dev
mailing list