How do I merge black and white rasters into one file using QGIS?
Also, rasters are overlaying so I´m interested into preserving only black colour.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
To add two rasters together, whilst preserving a value, as long as raster cell values are 1 or 0 is to multiply them in the raster calculator.
"raster1" * "raster2"
Multiplication works because: 1*1 = 1 and 1*0 = 0
Set the raster calculator to output the same crs as both your other layers, otherwise you could create a raster that ends up in a different location.
So as user30184 wrote - roads needs to be preserved (0*1=0) and this is wrong solution. I managed to solve the problem in GRASS GIS. I don't think it is possible to solve it in QGIS.
Merge tool don´t work since rasters overlap (white area than covers black).