avoid potential off-by-one errors when calculating raster offset