stars_index_to_loc: Convert a index (1, 2, 3,..., ncells*nbands) into stars...

View source: R/stars.R

stars_index_to_locR Documentation

Convert a index (1, 2, 3,..., ncells*nbands) into stars obeject to row, col, cell and band location coordinates

Description

Convert a index (1, 2, 3,..., ncells*nbands) into stars obeject to row, col, cell and band location coordinates

Usage

stars_index_to_loc(
  index = c(12L, 14L, 19L, 21L, 23L, 37L, 46L, 56L, 58L, 59L),
  x = toy_multi(nb = 3, nc = 5, nr = 4, mask = FALSE),
  form = c("table", "sf")[1]
)

Arguments

index

vector of multi-band index coordinates (1-d addresses into n-d space)

x

stars object

form

character, specifies output format as "table" (default) or "sf"

Value

a tibble of index, cell, col, row, x, y, and band

  • index, 1-based 3d index into objects if as array

  • cell, 1-based 2d index into each band as if a matrix

  • col, 1-based column index

  • row, 1-based row index

  • x, coordinate of center of cell, part of geometry if form is 'sf'

  • y, coordinate of center of cell, part of geometry if form is 'sf'

  • band, 1-based integer index of band


BigelowLab/twinkle documentation built on Jan. 26, 2025, 6:34 a.m.