We create the list as used by the stars/sf GDAL IO function 'gdal_read(, RasterIO_parameters)'.
rasterio_to_sfio(x)
rasterio params as from rasterio0()
list in sf RasterIO format
Note that the input is a 4 or 6 element vector, with offset 0-based and output dimensions optional (will use the source window). The resample argument uses the syntax identical to that used in GDAL itself.
rio <- rasterio0(c(0L, 0L), src_dim = c(24L, 10L))
rasterio_to_sfio(rio)
#> $nXOff
#> offset_x
#> 1
#>
#> $nYOff
#> offset_y
#> 1
#>
#> $nXSize
#> source_nx
#> 24
#>
#> $nYSize
#> source_ny
#> 10
#>
#> $nBufXSize
#> out_nx
#> 24
#>
#> $nBufYSize
#> out_ny
#> 10
#>
#> $resample
#> [1] "nearest_neighbour"
#>