Hello, I want to extract the road network data (coodinates of street and street name) from niedersachsen-latest.osm.pbf.

I first tried to convert the file into .sm format using Osmosis. I installed Osmosis on windows xp. I tried to convert niedersachsen-latest.osm.pbf to niedersachsen.osm usingthe command: osmosis --read-xml file=niedersachsen-latest.osm.pbf --write-xml file=niedersachsen.osm But I am getting error:

C:\Programme\osmosis-latest\bin>osmosis --read-xml file=niedersachsen-latest.osm .pbf --write-xml file=niedersachsen.osm 26.03.2013 12:07:22 org.openstreetmap.osmosis.core.Osmosis run INFO: Osmosis Version 0.42 26.03.2013 12:07:22 org.java.plugin.registry.xml.ManifestParser <init> INFO: got SAX parser factory - org.apache.xerces.jaxp.SAXParserFactoryImpl@1a8c4 e7 26.03.2013 12:07:22 org.java.plugin.registry.xml.PluginRegistryImpl configure INFO: configured, stopOnError=false, isValidating=true 26.03.2013 12:07:22 org.java.plugin.registry.xml.PluginRegistryImpl register INFO: plug-in and fragment descriptors registered - 1 26.03.2013 12:07:22 org.java.plugin.standard.StandardPluginManager activatePlugi n INFO: plug-in started - org.openstreetmap.osmosis.core.plugin.Core@0.42.0 26.03.2013 12:07:22 org.openstreetmap.osmosis.core.Osmosis run INFO: Preparing pipeline. 26.03.2013 12:07:22 org.openstreetmap.osmosis.core.Osmosis run INFO: Launching pipeline execution. 26.03.2013 12:07:22 org.openstreetmap.osmosis.core.Osmosis run INFO: Pipeline executing, waiting for completion. 26.03.2013 12:07:22 org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskMan ager waitForCompletion SCHWERWIEGEND: Thread for task 1-read-xml failed org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to parse xml file niedersachsen-latest.osm.pbf. publicId=(null), systemId=(null), lineNumber=1, columnNumber=1. at org.openstreetmap.osmosis.xml.v0_6.XmlReader.run(XmlReader.java:116) at java.lang.Thread.run(Unknown Source) Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un known 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.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispat

ch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un known 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 Sour ce) at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(Unknown Source) at org.openstreetmap.osmosis.xml.v0_6.XmlReader.run(XmlReader.java:111) ... 1 more 26.03.2013 12:07:22 org.openstreetmap.osmosis.core.Osmosis main SCHWERWIEGEND: Execution aborted. org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or more tasks failed . at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.waitForComple tion(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(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(Laun cher.java:329) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav a:239) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La uncher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java: 352) at org.codehaus.classworlds.Launcher.main(Launcher.java:47)

After converting it into .osm file I want to extract the road network data from it.

asked 26 Mar '13, 11:11

tfarooqi's gravatar image

tfarooqi
304510
accept rate: 0%


I think that you will need to use "read-pbf" to read a PBF file.

permanent link

answered 26 Mar '13, 11:17

SomeoneElse's gravatar image

SomeoneElse ♦
32.3k63335756
accept rate: 15%

Its working, thanks a lot. Can you suggest the command to extract the start and end coordinates of a link/Street alon with street's name?

(26 Mar '13, 11:44) tfarooqi
1

You're probably better off asking a separate question with a few more details of what you're trying to do. The answer to this question my help (although that's essentially doing the reverse of what you're attempting).

(26 Mar '13, 11:53) SomeoneElse ♦

I am using this querry to extract road network used by cars: osmosis --read-xml niedersachsen.osm --tf accept-ways highway=* --tf reject-ways highway=pedestrian,footway,steps,cycleway,bridleway --tf reject-relations --used-node --write-xml niedersachsen_roadnetwork.osm

But still I need to find the start and end coordinates of the street and street name, Any suggestions?

(26 Mar '13, 11:58) tfarooqi
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:

×551
×219
×119
×71
×31

question asked: 26 Mar '13, 11:11

question was seen: 5,291 times

last updated: 26 Mar '13, 12:23

powered by OSQA