Forrest logo
back to the gdal_translate tool

gdal_translate:tldr:fbe51

gdal_translate: Convert a GeoTiff to a Cloud Optimized GeoTiff.
$ gdal_translate ${path-to-input-tif} ${path-to-output-tif} -of COG -co COMPRESS=LZW
try on your machine

This command is using the gdal_translate tool from GDAL (Geospatial Data Abstraction Library) to convert a raster image file from one format to another. Here is the breakdown of the command:

  • ${path-to-input-tif}: This is a placeholder representing the path to the input TIFF file that you want to convert.

  • ${path-to-output-tif}: This is a placeholder representing the path where you want to save the converted output TIFF file.

  • -of COG: This option specifies the output format as COG (Cloud-Optimized GeoTIFF), which is an optimized form of GeoTIFF suitable for cloud storage and streaming.

  • -co COMPRESS=LZW: This option specifies the compression method to be used for the output file. In this case, LZW compression is chosen. LZW (Lempel-Ziv-Welch) is a lossless compression algorithm commonly used for reducing the file size of raster images while preserving their quality.

Overall, this command takes an input TIFF file, converts it to a cloud-optimized GeoTIFF, and applies LZW compression to the output file.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the gdal_translate tool