What are the acceptable input values for the LERC Precision parameter associated with the OptimizeRasters workflow?

1346
2
06-26-2017 10:11 AM
MattDelong
New Contributor

I have found references that the default is .001 for lossless compression, as well as references that lossy compression can be achieved with 10 - 50 centimeters LERC Precision according to the two white papers concerning the format and more importantly the compression that I have found. I have attempted several variations of this parameter to attempt to discover the relationship between centimeters and the parameter input to the automation but am receiving mixed results. For instance, the values .100, .010, 15, 20, & 25 result in no additional compression outside of the default. A value of 10 results in a file size 50 % or the default and 50 results in about 25% of default. In this case 10 is not enough compression and 50 is the correct file size but with entirely way to much loss to be useful. The other values that provide no further compression are only serving to confuse me further. If relevant the input raster is MrSID with Wavelet MG3 applied at about a 15:1 compression ratio. I appreciate any clarification that can be provided.

Thanks

Matthew DeLong

Sr GIS Analyst 

Arkansas GIS Office

0 Kudos
2 Replies
PeterBecker
Esri Regular Contributor

The output from OptimizeRasters is either TIF or MRF. TIF provides a number of compression options such as JPG, LZW, Packbits, (& None). MRF provides JPEG, PNG, LERC, (& None). LZW, Packbits, PNG  (& None) are Lossless compression. IE the output will have the same values as the input. JPEG and MrSID are lossy compression with the values changing depending on the compression quality set. If your input is a MrSID file with 1:15 compression factor, then the pixel values have already been changed quite significantly from their original values. Although this may be OK for some visual inspection of imagery, it will have a significant effect on any analysis. If you are looking for a lossy compression in MRF or TIF I would suggest using JPEG compression. Setting a compression value of about 80 would probably give you results that are similar to the MrSID values. The size of the TIF files will likely be about twice the size of the MrSID files, but may also contain more artifacts as the artifacts added by the MrSID compression will extenuate the JPEG artifacts. You would get better results if you can compress the original data. There is little value in using LERC compression on such previously lossy compressed natural color imagery.

LERC is a controlled lossy compression that takes a tolerance. The simplest way to understand this is when considering the compression of elevation data that is often stored as float values. Float values do not compress well using lossless compression due to the near random nature of the high precision. (Its difficult to compress the value 23.3435345). With LERC you can define a tolerance and on can consider that the data is quantized  to that tolerance. IE if the tolerance was 0.001 the above value would become 23.343. That would be sufficient precision for most applications and the value compressed better. Behind the scenes is it more complicated than this, but its a suitable analogy. If you provide it integer values then there will be no difference in the output till the tolerance is above 0.5. Internally to LERC is also has some other Lossless compression so there will be some compression of natural color imagery in comparison with non compressed imagery (typically 30% compression), but it is not very significant. The value becomes more interesting as one starts working with higher bit depth data. Typically imagery from modern sensors is captured at 14bit dynamic range as 16bit data. Often the data is the scaled to fit between 0 and 65535. Such values do not compress well, so LERC can be effective in defining the required precision. Setting a LERC tolerance of 4 will result in similar values such as 100,103,105,106 possibly being changes to the value 104  (IE within a tolerance of 4 from the original values). In this way higher bit depth imagery can also be compressed using LERC tolerance.

MattDelong
New Contributor

Thank you for the clarification, Peter. 

0 Kudos