NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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

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:

×252
×78

question asked: 19 Mar '12, 19:59

question was seen: 3,538 times

last updated: 25 Nov '14, 13:23

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum