[gdal-dev] Just want to do simple batch compression...

jratike80 jukka.rahkonen at maanmittauslaitos.fi
Wed Apr 4 02:04:17 PDT 2018


srygonic wrote
> I have a lot of geotiffs which are quite large at times (meaning they have
> quite a bit of unnecessary white space between) and I would like to run a
> batch script to just do a simple compression on them as I believe that
> they
> are not compressed because the files that just contain a lot of white
> space
> are still unnecessarily huge.

Hi,

If you run gdalinfo about your image you will notice that it is already
compressed:

Metadata:
  TIFFTAG_SOFTWARE=OrbitGIS 17.0.0
Image Structure Metadata:
  COMPRESSION=YCbCr JPEG
  INTERLEAVE=PIXEL
  SOURCE_COLOR_SPACE=YCbCr

However, one of your commands which is using actually the same parameters
does shrink the image from 465 MB into 170 MB. 

gdal_translate GTIFF_RAW:GAPS_2017-02-23.tif test2.tif -co 
PHOTOMETRIC=YCBCR -co TFW=YES -co TILED=YES -co BIGTIFF=IF_SAFER -co
COMPRESS=JPEG -a_srs EPSG:3414

For saving disk space I would consider cutting those areas which do have
real data into individual files and then combine them into a virtual mosaic
with gdalbuildvrt.  Empty space does compress rather well but not having any
pixels from areas with no data is most savvy option of all.

-Jukka Rahkonen-




--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list