Generate a table of tile indexes from a tiling object.

tile_index(x)

Arguments

x

tiling object, created by [tiles()]

Value

data frame, see details

Details

A data frame with

* **tile** - index, same as raster cell number * **offset_x** - column offset of tile (index column 0-based) * **offset_y** - row offset of tile (index row 0-based, relative to top row) * **ncol** number of columns in tile (the right and bottom margins may have a dangle based on block size) * **nrow** number of rows in th tile * xmin, xmax, ymin, ymax - the exent

Note that ncol,nrow is the block size *unless* the tile is part of a dangling column or row (right or bottom) where the raster doesn't fill complete tiles.

Examples

tile_index(grout(c(87, 61), extent = c(0, 1, 0, 1), blocksize = c(32, 16)))
#> # A tibble: 12 × 11
#>     tile offset_x offset_y tile_col tile_row  ncol  nrow  xmin  xmax  ymin  ymax
#>    <int>    <dbl>    <dbl>    <dbl>    <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#>  1     1        0        0        1        1    32    16 0     0.368 0.738 1    
#>  2     2       32        0        2        1    32    16 0.368 0.736 0.738 1    
#>  3     3       64        0        3        1    23    16 0.736 1     0.738 1    
#>  4     4        0       16        1        2    32    16 0     0.368 0.475 0.738
#>  5     5       32       16        2        2    32    16 0.368 0.736 0.475 0.738
#>  6     6       64       16        3        2    23    16 0.736 1     0.475 0.738
#>  7     7        0       32        1        3    32    16 0     0.368 0.213 0.475
#>  8     8       32       32        2        3    32    16 0.368 0.736 0.213 0.475
#>  9     9       64       32        3        3    23    16 0.736 1     0.213 0.475
#> 10    10        0       48        1        4    32    13 0     0.368 0     0.213
#> 11    11       32       48        2        4    32    13 0.368 0.736 0     0.213
#> 12    12       64       48        3        4    23    13 0.736 1     0     0.213
## only one tile in this weird scheme!
tile_index(grout(c(61, 87), blocksize = c(61, 87)))
#> # A tibble: 1 × 11
#>    tile offset_x offset_y tile_col tile_row  ncol  nrow  xmin  xmax  ymin  ymax
#>   <int>    <dbl>    <dbl>    <dbl>    <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1     1        0        0        1        1    61    87     0    61     0    87