I want to merge 2 raster files, but assigning the overlapped area to a specific one.
How could I do it?
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
The GRASS module
r.patch does exactly what you want. All cells in the output map are filled with the first input, unless it is NULL, in which case the second input is used. So, set your computational region to cover both maps, then run r.patch:
g.region -p rast=map_a,map_b r.patch input=map_a,map_b output=ab_mosaic
Take care that values of 0 in map_a will also be filled with map_b instead.