From c75fed794460cf1bebc420de69329c6103fe8000 Mon Sep 17 00:00:00 2001 From: Blayne Chard Date: Tue, 31 Oct 2023 11:23:28 +1300 Subject: [PATCH 1/2] fix: lerc is not lossy unless max_z_error is > 0 --- cloud-optimized-geotiffs/cogs-details.qmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud-optimized-geotiffs/cogs-details.qmd b/cloud-optimized-geotiffs/cogs-details.qmd index 415a274..c10e865 100644 --- a/cloud-optimized-geotiffs/cogs-details.qmd +++ b/cloud-optimized-geotiffs/cogs-details.qmd @@ -37,7 +37,7 @@ There are a variety of compression codecs supported by GeoTIFF. Compression code **JPEG** is a **lossy** compression codec useful for true-color GeoTIFFs intended to be used only for visualization. Because it's lossy, it tends to produce smaller file sizes than deflate or LZW. JPEG should only be used with RGB `Byte` data. -**LERC** (Limited Error Raster Compression) is a lossy but very efficient compression algorithm for floating point data. This compression rounds values to a precision provided by the user and tends to be useful e.g. for elevation data where the source data is known to not have precision beyond a known value. But note, this compression is **not lossless**. Additionally, LERC is a relatively new algorithm and may not be supported everywhere. GDAL needs to be compiled with the LERC driver in order to load a GeoTIFF with LERC compression. +**LERC** (Limited Error Raster Compression) is a very efficient compression algorithm for floating point data. This compression rounds values to a precision provided by the user and tends to be useful e.g. for elevation data where the source data is known to not have precision beyond a known value. But note, this compression is **not lossless** when used with a `MAX_Z_ERROR > 0`. Additionally, LERC is a relatively new algorithm and may not be supported everywhere. GDAL needs to be compiled with the LERC driver in order to load a GeoTIFF with LERC compression. Some other compression algorithms may be preferred depending on the data type and distribution, and if the goal is maximum compression or not. Codecs that produce the smallest file sizes _tend_ to take longer to read into memory. If the network bandwidth to load the file is slow, then a very efficient compression algorithm may be most efficient, even if it takes longer to decompress when loaded. Alternatively, if the network speed is very fast, or if reading from a local disk, a slightly less efficient compression codec that decompresses faster may be preferred. From 2876e5e11c74e463d8d72a046da5968db2b74216 Mon Sep 17 00:00:00 2001 From: Blayne Chard Date: Tue, 31 Oct 2023 11:48:43 +1300 Subject: [PATCH 2/2] refactor: reword to "precision" rather than gdal terms --- cloud-optimized-geotiffs/cogs-details.qmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud-optimized-geotiffs/cogs-details.qmd b/cloud-optimized-geotiffs/cogs-details.qmd index c10e865..6ae4242 100644 --- a/cloud-optimized-geotiffs/cogs-details.qmd +++ b/cloud-optimized-geotiffs/cogs-details.qmd @@ -37,7 +37,7 @@ There are a variety of compression codecs supported by GeoTIFF. Compression code **JPEG** is a **lossy** compression codec useful for true-color GeoTIFFs intended to be used only for visualization. Because it's lossy, it tends to produce smaller file sizes than deflate or LZW. JPEG should only be used with RGB `Byte` data. -**LERC** (Limited Error Raster Compression) is a very efficient compression algorithm for floating point data. This compression rounds values to a precision provided by the user and tends to be useful e.g. for elevation data where the source data is known to not have precision beyond a known value. But note, this compression is **not lossless** when used with a `MAX_Z_ERROR > 0`. Additionally, LERC is a relatively new algorithm and may not be supported everywhere. GDAL needs to be compiled with the LERC driver in order to load a GeoTIFF with LERC compression. +**LERC** (Limited Error Raster Compression) is a very efficient compression algorithm for floating point data. This compression rounds values to a precision provided by the user and tends to be useful e.g. for elevation data where the source data is known to not have precision beyond a known value. But note, this compression is **not lossless** when used with a precision greater than 0. Additionally, LERC is a relatively new algorithm and may not be supported everywhere. GDAL needs to be compiled with the LERC driver in order to load a GeoTIFF with LERC compression. Some other compression algorithms may be preferred depending on the data type and distribution, and if the goal is maximum compression or not. Codecs that produce the smallest file sizes _tend_ to take longer to read into memory. If the network bandwidth to load the file is slow, then a very efficient compression algorithm may be most efficient, even if it takes longer to decompress when loaded. Alternatively, if the network speed is very fast, or if reading from a local disk, a slightly less efficient compression codec that decompresses faster may be preferred.