Ebola
Ebola

Reputation: 43

can not find osmNetConvert.xml during the conversion

I am trying to convert OSM to network for SUMO. I do exactly as the below: I installed SUMO, Python 3.4.4 Downloaded OSM file from openstreetmap.com Using the command below to convert osm to net, bet here is the ERROR:

Error: Could not open types-file 'G:\Program Files\DLR\Sump /data/typemap/osmNetconvert.typ.xml'.

enter image description here

Upvotes: 0

Views: 1251

Answers (2)

user9798713
user9798713

Reputation: 1

Your command is missing = .

Correct command is:

 netconvert --osm-files=map.osm -o map.net.xml

Upvotes: 0

Michael
Michael

Reputation: 3680

This is actually a bug in the start-command-line.bat script you used. As you can see when looking closely it adds an extra space to the SUMO_HOME directory, you can verify it by doing

echo "%SUMO_HOME%"

which should result in

"G:\Program Files\DLR\Sumo"

but will probably print

"G:\Program Files\DLR\Sumo "

To fix it you need to edit the script G:\Program Files\DLR\Sumo\bin\start-command-line.bat and remove all the spaces in front of the && signs, so replace

cmd /K "set PATH=%PATH%;%sumo_home%\bin;%python_dir%;%sumo_home%\tools && set PYTHONPATH=%PYTHONPATH%;%sumo_home%\tools && set SUMO_HOME=%sumo_home% & cd /d %default_dir% && echo info: added location of sumo, tools and python to the search path && echo info: variable SUMO_HOME is set to %SUMO_HOME% && echo. && echo use the 'cd /d' command to change directory && echo example usage: && echo cd /d c:\foo\bar

with

cmd /K "set PATH=%PATH%;%sumo_home%\bin;%python_dir%;%sumo_home%\tools& set PYTHONPATH=%PYTHONPATH%;%sumo_home%\tools& set SUMO_HOME=%sumo_home%& cd /d %default_dir%& echo info: added location of sumo, tools and python to the search path& echo info: variable SUMO_HOME is set to %SUMO_HOME%& echo.& echo use the 'cd /d' command to change directory& echo example usage:& echo cd /d c:\foo\bar

or use the new version from the subversion repository if you want.

I also replaced the double ampersands ("&") with single ones although it does not really matter here because they only differ in functionality if any of the commands fail which should not happen with "set" or "echo". In any case with the single "&" execution will continue even if one of the commands fails, see How to run two commands in one line in Windows CMD?

Upvotes: 1

Related Questions