function resampleNearest(valueArrays, inWidth, inHeight, outWidth, outHeight) {
  const relX = inWidth / outWidth;
  const relY = inHeight / outHeight;
  return valueArrays.map((array) => {
    const newArray = copyNewSize(array, outWidth, outHeight);
    for (let y = 0; y < outHeight; ++y) {
      const cy = Math.min(Math.round(relY * y), inHeight - 1);
      for (let x = 0; x < outWidth; ++x) {
        const cx = Math.min(Math.round(relX * x), inWidth - 1);
        const value = array[(cy * inWidth) + cx];
        newArray[(y * outWidth) + x] = value;
      }
    }
    return newArray;
  });
}
Resample the input arrays using nearest neighbor value selection.
@param {TypedArray[]} valueArrays The input arrays to resample
@param {number} inWidth The width of the input rasters
@param {number} inHeight The height of the input rasters
@param {number} outWidth The desired width of the output rasters
@param {number} outHeight The desired height of the output rasters
@returns {TypedArray[]} The resampled rasters