Tuesday 11 February 2020

gdal - Creating compressed GeoTIFF with QGIS Clipper tool?


I have a geo-tiff created by Pix4D which is about 375 Mb in file size.


I have clipped it to a smaller area using Qgis 2.8(using Raster ‣ Extraction ‣ Clipper), and the output file is about 900 MB in size.


Why did the clipping process generate such a large file, when the source file was smaller?


How do I run the clipper tool so that it produces a smaller size?



Answer



The Clipper tool makes an uncompressed image by default. Read the GDAL manual of your format and add manually the compression options into the gdal_translate command that is shown in the lowest pane.


For example for GeoTIFF read http://gdal.org/frmt_gtiff.html and use for example-co COMPRESS=DEFLATE -co PREDICTOR=2 which gives a well compressed, lossless output for topographic maps.


enter image description here


If you think that it would be trivial to add compression options to the user interface of the Clipper tool it is not because more than 30 formats are supported for the output and all of them have different settings for compression if compression is supported at all.



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...