'How to set the resolution of a Raster using gdal.Grid in python 3?

How to set the output resolution of the raster generated in gdal.Grid? I am using the code below, which produces a TIF with very large cells (~70m) however the data referenced in the vrt (filepath_vrt_in) has data at sub-metre resolution. I get the same result when using inverse distance weighting algorithm, and nearest neighbour at x,y radius of 1m.

from osgeo import gdal
temp_wd = gdal.Grid("C:/Temp/Python-Output-WD-01.TIF", filepath_vrt_in, zfield="Z", algorithm = "nearest:radius1=5.0:radius2=5.0:angle=0.0:nodata=-9999")
temp_wd = None

I have also tried using gdal.Warp as below on the output TIF, which produces a TIF at similar resolution.

temp_warpwd = gdal.Warp("C:/Temp/Python-Output-WD-WARPED-01.TIF", "C:/Temp/Python-Output-WD-01.TIF", xRes=5, yRes=5)
temp_warpwd = None


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source