Skip to content

Commit 4b5ebaf

Browse files
committed
closes #2180
1 parent e91f5e3 commit 4b5ebaf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

R/sfc.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ st_sfc = function(..., crs = NA_crs_, precision = 0.0, check_ring_dir = FALSE, d
4343
# if we have only one arg, which is already a list with sfg's, but NOT a geometrycollection:
4444
# (this is the old form of calling st_sfc; it is way faster to call st_sfc(lst) if lst
4545
# already contains a zillion sfg objects, than do.call(st_sfc, lst) ...
46+
if (length(lst) && inherits(lst[[1]], "sf"))
47+
stop("use st_as_sfc() to extract geometries from an sf object")
4648
if (length(lst) == 1 && is.list(lst[[1]]) && !inherits(lst[[1]], "sfg")
4749
&& (length(lst[[1]]) == 0 || inherits(lst[[1]][[1]], "sfg") || is.null(lst[[1]][[1]])))
4850
lst = lst[[1]]

0 commit comments

Comments
 (0)