Using gdal_grid for spatial interpolation I have run across a problem: the nodata argument is ignored. The only solution I have found for this is to then use
gdal_translate but it is rather cumbersome (see below). My bash scripting skills are very, very minimal. Can anyone suggest an improvement, like passing the outputted file directly to the next tool?
gdal_grid -zfield "D2012" \ -a invdist:power=2.0:smoothing=0.0:radius1=0.0:radius2=0.0:angle=0.0:max_points=0:min_points=0:nodata=-9999 \ -txe 647822 651672 -tye 7535500 7537800 -outsize 77 46 \ -of GTiff -ot Float64 -l probe2004_2012 probe2004_2012.shp ./Output/temp.tiff gdal_translate -stats -a_nodata -9999 -a_srs EPSG:3006 ./Output/temp.tiff ./Output/2012_IDW_2_50.tiff rm ./Output/temp.tiff