[QGIS-Developer] Raster Calculator troubles in Processing with pyqgis

Nyall Dawson nyall.dawson at gmail.com
Tue Mar 12 00:17:44 PDT 2019


On Tue, 12 Mar 2019 at 17:13, matteo <matteo.ghetta at gmail.com> wrote:
>
> Hi devs,
>
> I'm facing a really strange bug (IMHO). Same script, same project, same
> data, same QGIS version (3.6), but different platform (linux vs windows).
>
> The EXPRESSION parameter is giving errors when used, ONLY in Windows.
>
> This is the small snippet I'm using without any problem in Linux:
>
> param_calculated = {
>         'EXPRESSION':'{}@1 * {}'.format(proximity['OUTPUT'], formula),
>         'LAYERS': proximity['OUTPUT'],
>         'OUTPUT': os.path.join(output, 'calcolato.tif')
> }
>
> calculated = processing.run("qgis:rastercalculator", param_calculated)
>
> The exact same script is giving an error in Windows (not verbose error,
> just saying processing.run is not running).
>
> I discovered that, if I load the raster(s) into the TOC and user
> my_raster.name() instead of the complete path (proximity['OUTPUT']) then
> it seems working.
>
> Is this a known bug/problem?

Does either of the platforms have OpenCL support enabled?

Nyall


More information about the QGIS-Developer mailing list