[QGIS-Developer] Updating qgis:rastercalculator to work better in models

Nyall Dawson nyall.dawson at gmail.com
Tue Jul 3 03:03:38 PDT 2018


On Sat, 30 Jun 2018 at 06:35, Rudi von Staden <rudivs at gmail.com> wrote:
>
> Hi all,
>
> I'm trying to make some updates to qgis:rastercalculator in processing
> to make it work better in models. The raster calculator evaluates
> expressions based on the source file name. The problem with using this
> in the model builder is that the file names are not always known up
> front.

This is indeed very tricky. Regular QGIS expressions are fine here,
because we can use expression contexts, variables and the like to
expose model parameters to the expression engine and support this
requirement. The raster expression engine however is very limited and
doesn't have any existing way to support this use case.

> Handling these three situations would improve the situation, but it's
> still a bit clunky (and complicated for users to understand). Another
> option would be to forego the source() names altogether, and use an a,
> b, c notation like many of the other raster calculators do.

I personally think this may be the best available approach, which
doesn't require complex changes to the raster expression engine.

Nyall


More information about the QGIS-Developer mailing list