Skip to content

Commit 8c7257e

Browse files
committed
tidy
1 parent dad3e82 commit 8c7257e

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

R/sfc.R

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,19 @@ st_sfc = function(..., crs = NA_crs_, precision = 0.0, check_ring_dir = FALSE, d
6464
dims_and_types = sfc_unique_sfg_dims_and_types(lst)
6565

6666
cls = if (length(lst) == 0) # empty set: no geometries read
67-
c("sfc_GEOMETRY", "sfc")
68-
else {
69-
# class: do we have a mix of geometry types?
70-
single = if (!is.null(attr(lst, "single_type"))) # set by CPL_read_wkb:
71-
attr(lst, "single_type")
67+
c("sfc_GEOMETRY", "sfc")
68+
else {
69+
# class: do we have a mix of geometry types?
70+
single = if (!is.null(attr(lst, "single_type"))) # set by CPL_read_wkb:
71+
attr(lst, "single_type")
72+
else
73+
length(dims_and_types[[2]]) == 1L
74+
attr(lst, "single_type") = NULL # clean up
75+
if (single)
76+
c(paste0("sfc_", dims_and_types[[2]][1]), "sfc")
7277
else
73-
length(dims_and_types[[2]]) == 1L
74-
attr(lst, "single_type") = NULL # clean up
75-
if (single)
76-
c(paste0("sfc_", dims_and_types[[2]][1]), "sfc")
77-
else
78-
c("sfc_GEOMETRY", "sfc") # the mix
79-
}
78+
c("sfc_GEOMETRY", "sfc") # the mix
79+
}
8080

8181
if (any(is_null)) {
8282
if (missing(dim)) {

0 commit comments

Comments
 (0)