[gdal-dev] GDAL Interpolation Help

2023-09-27 Thread Bill Myers via gdal-dev
Hi, I am new to working with GDAL. We are trying to spatially interpolate Numerical Weather Prediction (NWP) model data to an arbitrary location, i.e. lat/lon. We have been using gdal_translate but have been getting unexpected results. We have used the resampling method called "average". In this to

Re: [gdal-dev] GDAL Interpolation Help

2023-09-27 Thread Scott via gdal-dev
Averaging rasters is a common task. Often I see developers write many lines of python to do simple tasks like this. The following GDAL command should give you the results you're looking for: gdal_calc.py -A input1.tif -B input2.tif --outfile=result.tif --calc="(A+B)/2" The above command was

Re: [gdal-dev] GDAL Interpolation Help

2023-09-27 Thread Even Rouault via gdal-dev
Bill, here you upsample from a 3x3 to a 5x5 array. Consequently each target pixel averages 5/3 x 5/3 contributing source pixels , not 2 x 2.  This way the total sum of the values of the target array is preserved compared to to the sum of the values of the source array, if you multiply the sum