Skip to content

Commit

Permalink
transform all the sfc columns independently (#4382)
Browse files Browse the repository at this point in the history
  • Loading branch information
yutannihilation committed Mar 19, 2021
1 parent be50f53 commit 199be05
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/coord-sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ CoordSf <- ggproto("CoordSf", CoordCartesian,
return(layer_data)
}

sf::st_transform(layer_data, params$crs)
idx <- vapply(layer_data, inherits, what = "sfc", FUN.VALUE = logical(1L))
layer_data[idx] <- lapply(layer_data[idx], sf::st_transform, crs = params$crs)
layer_data
})
},

Expand Down

0 comments on commit 199be05

Please sign in to comment.