When I merge a lot of raster files I don't know what is the order that they forward in the new file (stacking).
How do I know the name of band 1 (and others ones) in the other file that I have had created.
Is there a default rule to 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 stacking order is the order in which you list the files in the command. I see you have another question about this tool. If you add a bunch of files selected from the file system, the order will most likely be the order they are in the file system and that might not be the stacking order you want, but you can edit the command by pressing the little yellow pencil icon next to the GDAL commandline window (see the answer to your previous question).
gdal_merge.py -separate -o out.tif in1.tif in2.tif in3.tif
would give you a 3 band raster where in1 is in the red band (band 1), in2 is in the green band (band 2) and in3 is in the blue band (band 3). But change the order in the command:
gdal_merge.py -separate -o out.tif in3.tif in2.tif in1.tif
would give you a 3 band raster where in3 is now in the red band, in2 is in the green band and in1 is now in the blue band.