Hi everybody,

I am working with Windows 7 64 bits and 0.47 osmosis. I am interested in extract some countries from old planet.osm but my osmosis doesn´t work properly with planet.osm older than 2010. It seems it is a problem about the XML format. From 2010 all the files are in 0.6 XML format but older files are in 0.5 XML format or even 0.4 or 0.3.

When I used osmosis the message is:

"Warning: Expected version 0.6 but received 0.5 ... Thread for task 1-read-xml failed ... Node 2 does not have a version attribute as OSM 0.6 are required to have. Is this a 0.5 file? ... the execution is aborted"

I can only think in two possible solutions:

  • Using an older osmosis which could manage 0.5 XML format: I tried 0.35 (it´s the oldest one that I found available) but It doesn´t work either (I read in the wiki that version support API 0.5 but now I think that API´s version is not the same concept that XML format)
  • Convert osm from 0.5 XML format to 0.6: I have no idea if this is possible. I found an old link about this (https://mapguy.wordpress.com/2009/11/06/how-to-make-your-own-movie-with-osm-evolution-part-i/ ) but it´s about converting from 0.4 to 0.5. Besides it works in Linux that It´s something I am not able to use.

Does anybody know how to fix this problem? Is it available in somewhere an older version of osmosis which allows to work with 0.5 XML format? Does anybody hear about a tool which converts XML formats?

Thanks!!!

asked 12 Jan '15, 15:11

frose's gravatar image

frose
100338
accept rate: 0%

edited 13 Jan '15, 19:04

SimonPoole's gravatar image

SimonPoole ♦
37.4k13281595


You may simply have to convert from 0.5 to 0.6 with osmosis 0.35 first: http://wiki.openstreetmap.org/wiki/Osmosis/Detailed_Usage_0.35#--migrate

permanent link

answered 13 Jan '15, 19:15

SimonPoole's gravatar image

SimonPoole ♦
37.4k13281595
accept rate: 19%

1

Problem solved!!! I have tried the SimonPoole´s idea and it works perfectly.

I used osmosis 0.35 to migrate from 0.5 to 0.6: osmosis --read-xml-0.5 enableDateParsing=no file="input_0.5.osm" --migrate --write-xml file="output_0.6.osm"

After that I was able to extract my AOI with osmosis 0.47.

Tank you very much!

(15 Jan '15, 09:00) frose

The differences between 0.5 and 0.6 are not so big; you can probably get away with changing your XML in an editor or scripting language of your choice by changing every occurrence of

user="

to

uid="1" version="1" changeset="1" user="

that would add the new required attributes and work as long as you're just processing the data for reading.

Having said that, the Osmosis version 0.35 should indeed work with the old files - what exactly is the error message, and are you sure that you've called 0.35 and not accidentally used the newer version?

permanent link

answered 13 Jan '15, 06:58

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
68.2k806201061
accept rate: 24%

I have tried to edit the XML but notepad ++ says that It is a too big file. Could you recommend me a programme which could manage files with the size of a planet.osm?

I am not really sure if I am using 0.35 osmosis. The message says so at the beginning but in the middle of the message I receive contradictory info:

ene 13, 2015 11:38:01 AM org.openstreetmap.osmosis.core.Osmosis run

INFORMACIËN: Osmosis Version 0.35

ene 13, 2015 11:38:01 AM org.java.plugin.registry.xml.ManifestParser <init>

INFORMACIËN: got SAX parser factory - org.apache.xerces.jaxp.SAXParserFactoryImpl@a1b4e7

ene 13, 2015 11:38:01 AM org.java.plugin.registry.xml.PluginRegistryImpl configure

INFORMACIËN: configured, stopOnError=false, isValidating=true

ene 13, 2015 11:38:01 AM org.java.plugin.registry.xml.PluginRegistryImpl register

INFORMACIËN: plug-in and fragment descriptors registered - 1

ene 13, 2015 11:38:01 AM org.java.plugin.standard.StandardPluginManager activatePlugin

INFORMACIËN: plug-in started - org.openstreetmap.osmosis.core.plugin.Core@0.35.0

ene 13, 2015 11:38:01 AM org.openstreetmap.osmosis.core.Osmosis run

INFORMACIËN: Preparing pipeline.

ene 13, 2015 11:38:01 AM org.openstreetmap.osmosis.core.Osmosis run

INFORMACIËN: Launching pipeline execution.

ene 13, 2015 11:38:01 AM org.openstreetmap.osmosis.core.Osmosis run

INFORMACIËN: Pipeline executing, waiting for completion.

ene 13, 2015 11:38:01 AM org.openstreetmap.osmosis.core.xml.v0_6.impl.OsmElementProcessor begin

ADVERTENCIA: Expected version 0.6 but received 0.5.

ene 13, 2015 11:38:01 AM org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskManager waitForCompletion

GRAVE: Thread for task 1-read-xml failed

org.openstreetmap.osmosis.core.OsmosisRuntimeException: Node 2 does not have a version attribute as OSM 0.6 are required to have. Is this a 0.5 file?

    at org.openstreetmap.osmosis.core.xml.v0_6.impl.NodeElementProcessor.begin(NodeElementProcessor.java:73)

    at org.openstreetmap.osmosis.core.xml.v0_6.impl.OsmHandler.startElement(OsmHandler.java:90)

    at org.apache.xerces.parsers.AbstractSAXParser.startElement(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(Unknown Source)

    at org.openstreetmap.osmosis.core.xml.v0_6.XmlReader.run(XmlReader.java:108)

    at java.lang.Thread.run(Unknown Source)

ene 13, 2015 11:38:01 AM org.openstreetmap.osmosis.core.Osmosis main

GRAVE: 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(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    at java.lang.reflect.Method.invoke(Unknown Source)

    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)

Thanks for your answer

(13 Jan '15, 11:14) frose
3

If you need a to perform line-by-line changes to large files on Windows, try "sed" from http://unxutils.sourceforge.net/ .

(13 Jan '15, 11:17) SomeoneElse ♦
Your answer
toggle preview

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:

×204
×75
×19

question asked: 12 Jan '15, 15:11

question was seen: 4,461 times

last updated: 15 Jan '15, 10:04

powered by OSQA