Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: How to merge images using gdal-merge and cmd(.bat file)  (Read 5530 times)

0 Members and 1 Guest are viewing this topic.

_unknown_

    Topic Starter


    Beginner

    • Experience: Beginner
    • OS: Windows 7
    How to merge images using gdal-merge and cmd(.bat file)
    « on: October 27, 2014, 02:50:26 AM »
    I'm new to these batch thing and I badly need your help. There are 4 to 5 projected images in one day. Let's say I have all the projected images for 3 days. For day 1, the file name are:

    T2010232034000.L2.Tera.tif
    T2010232035000.L2.Tera.tif
    T2010232036000.L2.Tera.tif
    T2010232037000.L2.Tera.tif

    For day 2, the file name are:

    T2010233045000.L2.Tera.tif
    T2010233046000.L2.Tera.tif
    T2010233047000.L2.Tera.tif
    T2010233048000.L2.Tera.tif
    T2010233049000.L2.Tera.tif

    For day 3, the file name are:

    T2010234050000.L2.Tera.tif
    T2010234051000.L2.Tera.tif
    T2010234052000.L2.Tera.tif
    T2010234053000.L2.Tera.tif
    T2010234054000.L2.Tera.tif

    How will I merge all the images that are for day 1, for day 2 and for day 3 and save each merged images to a new directory leaving only the T/datayear/juliandate as the filename for each day. Merging files is easy but doing it in batch and merging based on the images per day is making me crazy.

    Note: T2010232034000 = Terra/Data Year/Julian Date/HH/MM/SS

    Here is the script I used in merging the files:

    gdal_merge.py -n 0 -a_nodata -32767 -of GTiff -o output_directory input_directory_in1.tif input_directory_in2.tif input_directory_in3.tif input_directory_in4.tif/input_directory_in5.tif


    « Last Edit: October 27, 2014, 03:26:27 AM by _unknown_ »

    Squashman



      Specialist
    • Thanked: 134
    • Experience: Experienced
    • OS: Other