Skip to content

Commit c131025

Browse files
committed
fix sits_merge bug when merging raster_cube with sar_cube
1 parent f15eab3 commit c131025

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

R/sits_merge.R

+5-5
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ sits_merge.raster_cube <- function(data1, data2, ...) {
132132
.data[["tile"]]
133133
)
134134

135-
if (inherits(data2, "raster_cube")) {
136-
return(.merge_equal_cube(data1, data2))
137-
} else {
135+
if (inherits(data2, "sar_cube")) {
138136
return(.merge_distinct_cube(data1, data2))
137+
} else {
138+
return(.merge_equal_cube(data1, data2))
139139
}
140140
}
141141

@@ -152,8 +152,8 @@ sits_merge.raster_cube <- function(data1, data2, ...) {
152152

153153
.merge_distinct_cube <- function(data1, data2) {
154154
# Get cubes timeline
155-
d1_tl <- unique(as.Date(unlist(.cube_timeline(data1))))
156-
d2_tl <- unique(as.Date(unlist(.cube_timeline(data2))))
155+
d1_tl <- unique(as.Date(.cube_timeline(data1)[[1]]))
156+
d2_tl <- unique(as.Date(.cube_timeline(data2)[[1]]))
157157

158158
# get intervals
159159
d1_period <- as.numeric(

0 commit comments

Comments
 (0)