0

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
CJA888
  • 1
  • 2
  • https://gdal.org/programs/gdal_grid.html#cmdoption-gdal_grid-tr ? – Val Apr 29 '22 at 12:33
  • Thanks, but that link points to GDAL CLI. Question was about python gdal library. I can use -tr options if I was using GDAL CLI but I'm not. I'm using python – CJA888 May 03 '22 at 07:33

0 Answers0