[gdal-dev] Source pixels used when warping using cubic resampling

Gregory, Matthew matt.gregory at oregonstate.edu
Fri Oct 25 09:02:57 PDT 2019


Hi all,

I am warping and upsampling an image from 4km to 30m using cubic resampling.  I've been warping different sized windows from the source image like this:

# Larger window
gdalwarp
  -t_srs EPSG:5070
  -te -2303985 2406015 -2033985 2649015
  -tr 30 30
  -of GTiff
  -r cubic
  in.vrt
  out.tif

# Single line of above window
gdalwarp
  -t_srs EPSG:5070
  -te -2303985 2648985 -2033985 2649015
  -tr 30 30
  -of GTiff
  -r cubic
  in.vrt
  line.tif

Naively, my expectation was that the overlap region would have identical values, but they don't.  I assume this means that the source (4km) pixels are being subset down to a smaller window before warping in the latter case that don't necessarily include the same 16 nearest pixels as in the first case?  I had a brief look through the Warp API tutorial and it looks like it may have something to do with the GDALSuggestedWarpOutput, but I didn't dig too deeply there.  

Is there a recommended workflow if you want to warp and resample destination rasters by blocks rather than the full extent at once?

Thanks for advice,
matt


More information about the gdal-dev mailing list