This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Calling osmosis using Python on Windows

0

How do I structure a command to call osmosis using Python on Win 7? I want to use Python so that I can loop through several different bounding boxes

For example, if I use the following command I can call osmosis:

import subprocess
subprocess.call(['J:/osmosis-0.40.1/bin/osmosis.bat'])

If try passing more arguments using this approach I get an error:

import subprocess    
subprocess.call(['J:/osmosis-0.40.1/bin/osmosis.bat', '--read-xml', 'enableDateParsing=no', 'file="J:/DATA/OSM/massachusetts.osm.bz2"', '--bounding-box top=42.48 left=-71.31 bottom=42.23 right=42.48', '--write-xml', 'file="J:/DATA/OSM/extracted_using_py.osm.bz2"'])

This question is based on my earlier question today about using osmosis/bzcat. I'm not sure how to break up my arguments (and I've tried a lot of different options).

asked 19 Mar '12, 19:59

djq's gravatar image

djq
16225
accept rate: 0%

1

What error do you get?

(25 Nov '14, 13:23) rorym

Source code available on GitHub .