rmf_as_array.sf | R Documentation |
Convert a simple features object to a rmf_array (rasterize)
## S3 method for class 'sf' rmf_as_array( obj, dis, select, na_value = 0, prj = rmf_get_prj(dis), sparse = TRUE, kper = attr(obj, "kper"), ... )
obj |
|
dis |
|
select |
integer or character specifying which column from |
na_value |
value of the cells in the array which are not specified in obj; defaults to 0 |
prj |
|
sparse |
logical; should a 2d (TRUE; default) or 3d (FALSE) array be returned |
kper |
optional integers specifying the stress-periods during which this array is active |
... |
additional arguments passed to |
stars::st_rasterize
is used to rasterize obj
to the MODFLOW grid which calls GDALRasterize.
Alternatively, the user can call rmf_as_list
on obj
and rmf_as_array
on the resulting rmf_list
. Results may differ.
a rmf_2d_array
if sparse = TRUE
; a rmf_3d_array
if sparse = FALSE
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), geom = sfc) dis <- rmf_create_dis() rmf_as_array(obj, dis = dis, select = 'q') rmf_as_array(obj, dis = dis, select = 'q', options = c('MERGE_ALG=ADD')) # alternative rmf_as_list(obj, dis = dis, select = 'q') %>% rmf_as_array(dis = dis)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.