I want to ask how to convert PNG to GeoTIFF using GDAL in Python. I ran this code but it's not work and I want to export the output into my computer.
How can I fix my code?
ds = gdal.Open('input.png')
gt = gdal.Translate(ds, 'output.tif', projWin = [-180, 90, 180, -90])
gt = None
Best Answer
I'm assuming that your PNG file doesn't have geolocation information embedded but you know what the corners of the data. I think you just had the wrong option for
gdal.Translate
. Check this out using a random example image that should span the same extent as you had in your example. I also assume that it is in WGS84 Latitude/Longitude (not quite for my example)