Skip to content

Commit

Permalink
Merge pull request #36 from FlukeAndFeather/crs-wkt
Browse files Browse the repository at this point in the history
Fixes issue #35
  • Loading branch information
Noam Ross authored Jul 24, 2020
2 parents 549ffee + 9e8118a commit ff0c9c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/raster-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

1 comment on commit ff0c9c8

@mdsumner
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this means fasterize now implicitly depends on sf - because sf sneakily triggers churn through PROJ and GDAL when you call $proj4string, I think it makes more sense to make that explicit and st_transform the sf to crs of the raster template. I'll have a closer look, this note just for me :)

Please sign in to comment.