Hi Andreas, I totally agree with the benefit of using SQL-like syntax as in expressions to calculate rasters.
I would prefer something like CASE WHEN raster1@1 > raster2@1 THEN raster1@1 ELSE raster2@1 END Having to multiply the result of a condition (0 or 1) by the band value to actually get the band values seems cumbersome for some users. Thanks for raising this issue. Michael 2014-04-24 15:25 GMT+02:00 Andreas Neumann <a.neum...@carto.net>: > Hi Carlos, > > Thanks a lot. This works fine. > > Seems I first have to get used to the raster calculator syntax. Would be > great if it would use the expression editor as is used almost everywhere > else. > > Andreas > > Am 24.04.2014 12:57, schrieb Carlos Cerdán: > > Hi Andreas: > > > > Yes, it always evaluates to true because of "OR" condition , so try: > > > > (lake_mask > 0) * lake_mask + (lake_mask<=0)*dtm > > > > Good luck > > > > Carlos > > > > > > > > > > 2014-04-24 1:53 GMT-05:00 Andreas Neumann <a.neum...@carto.net>: > > > >> Hi, > >> > >> I have a hard time understanding the raster calculator syntax. > >> > >> I would like to merge two rasters: DTM and lake mask. Let's call the one > >> dtm and the other lake_mask. > >> > >> When the lake_mask has a value > 0 then I would like to take the value > >> of the lake_mask, otherwise the value of the dtm. > >> > >> What would an appropriate syntax look like? > >> > >> I tried something along > >> > >> ((lake_mask > 0) * lake_mask) OR dtm > >> > >> But all I get in the resulting grid are values of 1. I guess it is > >> because it always evaluates to true? > >> > >> Thanks for your help. > >> > >> Andreas > >> _______________________________________________ > >> Qgis-user mailing list > >> Qgis-user@lists.osgeo.org > >> http://lists.osgeo.org/mailman/listinfo/qgis-user > >> > > > > > > > > _______________________________________________ > > Qgis-user mailing list > > Qgis-user@lists.osgeo.org > > http://lists.osgeo.org/mailman/listinfo/qgis-user > > > > _______________________________________________ > Qgis-user mailing list > Qgis-user@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/qgis-user >
_______________________________________________ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user