7

I am merging several geoTIFFs into one and am using the -co COMPRESS=DEFLATE create option for geoTIFFs. An additional switch is the predictor switch.

What does it do? The GDAL website is not clear on this. It mentions horizontal differencing and floating point prediction. But I have no idea what is meant by these terms. Thanks for your answer.

8

Compression predictors store the difference between neighbouring cell values, rather than the values themselves. If your raster has a continuously-varying value across a field, you may end up with a smaller file size when enabling a predictor. If, however, there are sudden changes in value in your raster, a predictor would probably not help much with the file size. Predictors are called filter algorithms in the PNG specification, and describes how they work quite well.

If your raster does not contain floating point values, you will not get any effect from floating point prediction.

Data compression is always a trade-off between the relative values of:

  • your time (both processing, and your time spent fiddling with options);
  • storage cost;
  • compatibility (there will still be some programs, somewhere, that choke on anything but uncompressed TIFFs).

Unless you're on a seriously storage-constrained system, the only time (wild hand-wavy generalization here) that file size matters these days is if you're transmitting data. 7Zipping a whole folder takes a whole lot less time, and ends up with a much smaller overall data size, than working with compressed rasters in your daily workflow.

  • OK thanks. Do you know what the difference is between the horzonal differencing and floating point predictions? – Freeze Sep 12 '13 at 11:25
  • updated my answer to include it. – scruss Sep 12 '13 at 12:23
  • That does not explain much. Is floating point also doing horizontal differencing? – bugmenot123 May 24 at 11:55
  • The answer is yes, but on floating point values. ;) – bugmenot123 May 24 at 12:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.