Skip to content

Commit 2f6452f

Browse files
authored
Merge pull request #165 from rolfsimoes/dev
Merge M3nin0/rstac dev
2 parents 536137f + c43e7cf commit 2f6452f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

R/items-funs.R

+8-1
Original file line numberDiff line numberDiff line change
@@ -701,9 +701,16 @@ items_as_tibble.doc_item <- function(items) {
701701
items_as_tibble.doc_items <- function(items) {
702702
check_items(items)
703703
non_atomic <- non_atomic_properties(items)
704+
properties <- items_fields(items, "properties")
704705
data <- lapply(items$features, function(item) {
706+
# fill unavailable properties
707+
unavailable_properties <- setdiff(properties, names(item$properties))
708+
item$properties[unavailable_properties] <- NA
709+
# update non-atomic properties
705710
item$properties[non_atomic] <- lapply(item$properties[non_atomic], list)
706-
item$properties
711+
# return properties from items in the same order
712+
# to avoid errors in the `mapply`
713+
item$properties[properties]
707714
})
708715
data <- do.call(mapply, args = c(list(FUN = c, SIMPLIFY = FALSE), data))
709716
structure(

0 commit comments

Comments
 (0)