function resample(valueArrays, inWidth, inHeight, outWidth, outHeight, method = 'nearest') {
  switch (method.toLowerCase()) {
    case 'nearest':
      return resampleNearest(valueArrays, inWidth, inHeight, outWidth, outHeight);
    case 'bilinear':
    case 'linear':
      return resampleBilinear(valueArrays, inWidth, inHeight, outWidth, outHeight);
    default:
      throw new Error(`Unsupported resampling method: '${method}'`);
  }
}
Resample the input arrays using the selected resampling method.
@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
@param {string} [method = 'nearest'] The desired resampling method
@returns {TypedArray[]} The resampled rasters