在Windows OS中的python中运行GDAL命令

时间:2019-01-19 01:34:41

标签: python cmd subprocess gdal os.system

我在Windows中使用GDAL来执行一些地理空间计算。它已成功安装并在命令提示符下顺利运行。这是正在运行的批处理文件的内容:

gdalwarp -of GTiff -tr 0.1 0.1 -te 89.60 22.80 94.25 25.80 ../Precipitation/IMERG/precip.imerg.20190117.tif ../Precipitation/IMERG/meghna.precip.imerg.20190117.tif
gdal_translate -of AAIGrid ../Precipitation/IMERG/meghna.precip.imerg.20190117.tif ../Precipitation/IMERG/meghna.precip.imerg.20190117.txt

问题是当我使用子进程在python中运行相同的批处理文件时。上面的命令没有执行,并且没有产生任何输出。这是python示例代码:

import subprocess
subprocess.Popen("Batchfile.bat")

我还尝试了无法运行的os.system。任何对此的建议将不胜感激。预先感谢。

0 个答案:

没有答案