From 9e8118a55023aa0e044c34487725fd2326733c9a Mon Sep 17 00:00:00 2001 From: Max Czapanskiy Date: Sat, 30 May 2020 15:15:17 -0700 Subject: [PATCH] Fixes issue #35 --- R/raster-methods.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/raster-methods.R b/R/raster-methods.R index bf2c17b..d252ee2 100644 --- a/R/raster-methods.R +++ b/R/raster-methods.R @@ -19,7 +19,7 @@ setMethod('raster', signature(x='sf'), ext <- raster::extent(bb) r <- raster::raster(ext, ...) - r@crs <- CRS(attr(x[[attr(x, "sf_column")]], "crs")[["proj4string"]]) + r@crs <- CRS(attr(x[[attr(x, "sf_column")]], "crs")$proj4string) if (!missing(origin)) { raster::origin(r) <- origin r <- raster::extend(r, 1)