I need to re-project a .tiff file from EPSG:4326 - WGS 84 - Geographic to EPSG: 32638 (UTM Zone 38N). When I run the code below the output file is a re-projected .tiff half the size of the original one.
# Reprojection
from osgeo import gdal
filename = r"/home/DATA/Test.tif"
input_raster = gdal.Open(filename)
output_raster = r"/home/DATA/Test_UTM38N.tif"
gdal.Warp(output_raster,input_raster,dstSRS="+init=epsg:32638")
I have had a similar experience when using the command line version of gdalwarp. Specifying the x and y resolution fixed the problem. I.e., In my case, adding '-tr 1000 1000' to the gdalwarp command produced a reprojected output grid about the same size as the original.
Also note that the gdalwarp doc for the '-tr' option (https://gdal.org/programs/gdalwarp.html#cmdoption-gdalwarp-tr) says: