rmf_as_list.stars: Convert a stars object to rmf_list

View source: R/spatial.R

rmf_as_list.starsR Documentation

Convert a stars object to rmf_list

Description

Convert a stars object to rmf_list

Usage

## S3 method for class 'stars'
rmf_as_list(
  obj,
  dis,
  select = names(obj),
  k = NULL,
  prj = rmf_get_prj(dis),
  kper = attr(obj, "kper"),
  op = sf::st_intersects,
  ...
)

Arguments

obj

stars object

dis

RMODFLOW list object

select

integer or character vector denoting the variables to select from obj. Defaults to all variables.

k

optional integer specifying the layer index for each feature. If not present, all features are assumed to be in layer 1.

prj

RMODFLOW prj object

kper

optional integers specifying the stress-periods during which this rmf_list is active

op

geometric operator to use in the spatial join. Defaults to sf::st_intersects. See details.

...

additional arguments passed to rmf_as_list.sf

Details

obj is converted to sf using sf::st_as_sf. rmf_as_list is then called on the resulting sf object. This function is intended for stars objects with geometry dimensions (e.g. sf objects).

Value

a rmf_list object

Examples

sfc <- sf::st_sfc(list(sf::st_point(c(100,200)), sf::st_point(c(750, 800)), sf::st_point(c(700, 850))))
obj <- sf::st_sf(q = c(-500, -400, -300), m = 2, geom = sfc)
s <- stars::st_as_stars(obj)
dis <- rmf_create_dis()
rmf_as_list(s, dis)

rogiersbart/RMODFLOW documentation built on Jan. 14, 2023, 4:21 a.m.