I want to port a gdal_translate
into Python. It is about translating a GeoTIFF into a Cloud Optimized GeoTIFF (COG). I do not know how to insert the option -of
and its input.
Here's is the equivalent CLI for that:
gdal_translate input.tif output_cog.tif -of COG -co COMPRESS=LZW
My current Python Code:
from osgeo import gdal
ds = gdal.Open('input.tif')
ds = gdal.Translate('output.tif', ds, options=["COMPRESS=LZW"])
How can I insert the input/argument -of COG
into the Python code?
I got the code here: https://www.cogeo.org/developers-guide.html