如何结合栅格分析算法?

问题描述 投票:0回答:0

我有两个光栅文件存储在一个名为结果的变量中。

results[file1] = outputs['QGIS Algorithm 1']['OUTPUT']
results[file2] = outputs['QGIS Algorithm 2']['OUTPUT']

是否可以将其用作栅格计算器算法的输入。沿线的东西

alg_params = {
            'CELLSIZE': 0,
            'CRS': None,
            'EXPRESSION': '0.3*"results[file1]@1"+0.7*"results[file1]@1"',
            'EXTENT': None,
            'LAYERS': 'some layer,
            'OUTPUT': QgsProcessing.TEMPORARY_OUTPUT
        }
        outputs['RasterCalculator'] = processing.run('qgis:rastercalculator', alg_params, context=context, feedback=feedback, is_child_algorithm=True)
        results['Vulnerability'] = outputs['RasterCalculator']['OUTPUT']
python qgis
© www.soinside.com 2019 - 2024. All rights reserved.