Created
May 18, 2020 12:18
-
-
Save cbrown5/65ac150cb71de8cc6c7923313a2b72f5 to your computer and use it in GitHub Desktop.
Revisions
-
cbrown5 created this gist
May 18, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ #Takes as an input a stars raster layer #CJ Brown 2020-05-18 st_as_raster <- function(rstars){ rext <- st_bbox(rstars) raster(t(rstars[[1]]), xmn = rext[1], xmx = rext[3], ymn = rext[2], ymx=rext[4], crs = st_crs(rstars)$proj4string) }