Gdal module that handles tif data etc. gdal_merge.py is a script in that module that merges tif data based on location information.
When I ran the script (below) in the document ...
python gdal_merge.py -init 255 -o out.tif in1.tif in2.tif
Even though I just combined two files of about 150MB, a huge file over 30GB was generated. (I looked back many times that the Finder might have mistaken G and M)
It seems that the tif file is basically compressed, and if you add a tag indicating the compression method to the script above, it will be compressed. It seems that a large file will be created by synthesizing images at distant points in order to compress parts that have no value.
python gdal_merge.py -init 255 -o out.tif in1.tif in2.tif -co COMPRESS=DEFLATE
This will generate a composite file of about 150MB. By the way, there seems to be a compression method with high file compatibility, although the compression rate will be slightly lower.
python gdal_merge.py -init 255 -o out.tif in1.tif in2.tif -co -co COMPRESS=LZW
Recommended Posts