python - 如何使用 GDAL 在 QGIS 中将许多栅格与 python 脚本合并?
问题描述
我有许多我试图组合以产生轮廓的栅格。它们采用 .bil 格式,所以我知道我需要先使用 gdal 翻译它们,但我的尝试都没有奏效。
我尝试使用 gdal_translate 和 gdal_merge 没有成功。下面是我尝试合并的两个 .bil 的示例。
import subprocess
import sys
import gdal
#imagea ='C:\\Users\\jeswa\\Desktop\\New folder\\N34_E\\n34_e024_1arc_v3.bil'
#imageb ='C:\\Users\\jeswa\\Desktop\\New folder\\N34_E\\n34_e025_1arc_v3.bil'
#output = 'C:\\Users\\jeswa\\Desktop\\test'
#subprocess.call(['gdal_merge', '-o', output, imagea, imageb])
Traceback (most recent call last):
File "C:\OSGEO4~1\apps\Python37\lib\code.py", line 90, in runcode
exec(code, self.locals)
File "<input>", line 1, in <module>
File "C:\OSGEO4~1\apps\Python37\lib\subprocess.py", line 304, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\OSGEO4~1\apps\Python37\lib\subprocess.py", line 756, in __init__
restore_signals, start_new_session)
File "C:\OSGEO4~1\apps\Python37\lib\subprocess.py", line 1155, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
解决方案
推荐阅读
- postgresql - 如何在 helm 图表中使用 postgres-exporter 的 --extend.query-path 参数?
- html - 如何更改小盒子内容的行?
- php - MySQL WHERE 过滤器基于 SELECT 中的子查询
- php - 水平显示每周数据
- javascript - 为什么我的克隆数组的代码不起作用 JavaScript
- jupyter-notebook - 为什么在 jupyter notebook 中找不到该文件?
- python - Discord.py Bot 响应时间过长
- python - 破折号回调依赖于先前回调中的先前计算和 # 参数的 TypeError
- git - 我可以在不从远程删除它们的情况下删除本地 git 存储库中的文件吗?
- siddhi - 如何让 siddhi 电子邮件接收器工作