I need to perform an operation on a raster file. My first attempt was with mapcalc in GRASS, but I got lost with the way it handles the 0 values, I am around 0, there migth be many zero values. I am working with double numbers. Maybe, it can be done in QGIS, which will be nice.
In simple words, this is like adding a building on a surface, but limiting it to 2 m and modifying anything if there no building or it is below surface.
The input:
- Raster1: a regular dtm with some null values in the bounduaries (I could have it in many format)
- Raster2: a same size and resolution but with a small surface within non null values of the previous raster
The logical operation, raster3 is the result:
if raster1 = null then raster3:=null
else
if raster2 = null then raster3:= raster1
else
if raster2 <> null then
if raster2-raster1>0 and raster2-raster1<2 then
raster3:=raster2
else
if raster2-raster1>=2 then raster3:=raster1+2
else raster3:= raster1
It looks that I have a code, but I have never coded anything in GRASS or QGIS