I'm trying to resample a GeoTIFF file to match another raster layer using python GDAL package. Most of the ways I found online is to use gdalwarp resample data from the command line. Is there a way to get cell resolution inside of python script and do the resample process inside of the python script? Maybe things like:
disout.SetGeoTransform(diskin.GetGeoTransform())
Best Answer
I found that the easiest way is to create a new raster file with dimensions equal to the reference file, SetGeoTransofrm and SetProjection of the new raster file to match the reference file then re-project the file and output, sample code shown below: