0

I need to sum two rasters (r1 and r2) using QGIS. They're made of 0s and 1s (black/white), and overlap only slightly over a common border. In the overlapping area, r1 has data in part of it, and r2 has data in another part, that's why I need a sum, not a merge (a merge would erase part of the data).

When I go to Raster Calculator, I can use a formula such as

"r1@1" + "r2@1"

but the Select Layer Extent only allows me to choose the extent of one of them. Since it's a kind of merge, the final extent should include both original rasters. I can increase the extent by hand, but I also need to calculate the number of columns and rows by hand? I don't want any resampling. Is there a way to automate this calculation, instead of doing it by hand (hard and error prone)?

1 Answer 1

1

Well, I managed to solve it using a “dummy” raster, which was a merge of all my tiles. Maybe not the best solution, but it worked. Strange thing is that I chose Byte as the output data type, and still the merge of my original TIFF rasters (72.8 MB) became a massive TIFF file (591.1 MB).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.