[OSM-talk] cannot process keep right dump in osmosis
Nic Roets
nroets at gmail.com
Thu Apr 15 13:05:09 BST 2010
So the problem is that keepright does not escape the # character. It's
easy to remove those lines with grep, e.g.
egrep -v '#[0-9]{4}' keepright_world.osm | ./osmosis --read-xml
file=/dev/stdin --bounding-polygon
file="mmla_south.poly" --write-xml file=keepright_mmla_south.osm
or fix them with sed.
On Thu, Apr 15, 2010 at 1:57 PM, maning sambale
<emmanuel.sambale at gmail.com> wrote:
> sed -n '48599235,48599238p' keepright_world.osm
> <tag k='state' v='new' />
> <tag k='description' v='There is more than one node in this spot.
> Offending node IDs: #356511061,#356507533' />
> <tag k='first_occurrence' v='2010-02-14 01:00:00' />
> <tag k='last_checked' v='2010-04-12 23:00:00' />
>
> On Thu, Apr 15, 2010 at 7:55 PM, Nic Roets <nroets at gmail.com> wrote:
>> Can you go to line 48599236 with a text editor and see what the
>> problem is ? Perhaps a few lines before and after ?
>>
>> On Thu, Apr 15, 2010 at 1:44 PM, maning sambale
>> <emmanuel.sambale at gmail.com> wrote:
>>> nic,
>>>
>>>> To see which lines are wrong, try this command :
>>>> egrep '&#[0-9]*;' keepright_world.osm
>>>
>>> running the above, no errors were reported.
>>>
>>>> To filter them from osmosis, try this:
>>>> egrep -v '&#[0-9]*;' keepright_world.osm | ./osmosis --read-xml
>>>> file=/dev/stdin --bounding-polygon
>>>> file="mmla_south.poly" --write-xml file=keepright_mmla_south.osm
>>> This one comes out with similar errors as before:
>>> 04 15, 10 7:37:04 PM org.openstreetmap.osmosis.core.Osmosis run
>>> INFO: Osmosis Version 0.34
>>> 04 15, 10 7:37:05 PM org.openstreetmap.osmosis.core.Osmosis run
>>> INFO: Preparing pipeline.
>>> 04 15, 10 7:37:05 PM org.openstreetmap.osmosis.core.Osmosis run
>>> INFO: Launching pipeline execution.
>>> 04 15, 10 7:37:05 PM org.openstreetmap.osmosis.core.Osmosis run
>>> INFO: Pipeline executing, waiting for completion.
>>> 04 15, 10 7:39:51 PM
>>> org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskManager
>>> waitForCompletion
>>> SEVERE: Thread for task 1-read-xml failed
>>> org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to
>>> parse xml file /dev/stdin. publicId=(null), systemId=(null),
>>> lineNumber=48599236, columnNumber=3.
>>> at org.openstreetmap.osmosis.core.xml.v0_6.XmlReader.run(XmlReader.java:113)
>>> at java.lang.Thread.run(Thread.java:619)
>>> Caused by: org.apache.xerces.impl.io.MalformedByteSequenceException:
>>> Invalid byte 2 of 3-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.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:198)
>>> at org.openstreetmap.osmosis.core.xml.v0_6.XmlReader.run(XmlReader.java:108)
>>> ... 1 more
>>> Caused by: org.apache.xerces.impl.io.MalformedByteSequenceException:
>>> Invalid byte 2 of 3-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.scanName(Unknown Source)
>>> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
>>> Source)
>>> ... 11 more
>>> 04 15, 10 7:39:51 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:85)
>>> at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:30)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>> 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)
>>>
>>>
>>> If it helps, I'm using ubuntu karmic with 1GB ram and 2 GB swap
>>> --
>>> cheers,
>>> maning
>>> ------------------------------------------------------
>>> "Freedom is still the most radical idea of all" -N.Branden
>>> wiki: http://esambale.wikispaces.com/
>>> blog: http://epsg4253.wordpress.com/
>>> ------------------------------------------------------
>>>
>>
>
>
>
> --
> cheers,
> maning
> ------------------------------------------------------
> "Freedom is still the most radical idea of all" -N.Branden
> wiki: http://esambale.wikispaces.com/
> blog: http://epsg4253.wordpress.com/
> ------------------------------------------------------
>
More information about the talk
mailing list