diff --git a/src/series.jl b/src/series.jl index b4070f4a9..337eb8711 100644 --- a/src/series.jl +++ b/src/series.jl @@ -52,6 +52,8 @@ DD.modify(f, A::AbstractRasterSeries) = map(child -> modify(f, child), values(A) RasterSeries(paths::AbstractArray{<:AbstractString}, dims; child, duplicate_first, kw...) RasterSeries(path:::AbstractString, dims; ext, separator, child, duplicate_first, kw...) + RasterSeries(objects::AbstractBasicDimArray; kw...) + Concrete implementation of [`AbstractRasterSeries`](@ref). A `RasterSeries` is an array of `Raster`s or `RasterStack`s, along some dimension(s). @@ -127,6 +129,8 @@ function RasterSeries( ) where {A<:AbstractArray{T,N},D<:Tuple,R<:Tuple} where {T,N} RasterSeries{T,N,D,R,A}(data, dims, refdims) end +RasterSeries(data::DD.AbstractBasicDimArray; kw...) = + RasterSeries(data, dims(data); kw...) function RasterSeries(data::AbstractArray{<:Union{AbstractRasterStack,AbstractRaster}}, dims; refdims=() ) diff --git a/test/series.jl b/test/series.jl index 694c1ce8b..e5ebb5ed8 100644 --- a/test/series.jl +++ b/test/series.jl @@ -19,6 +19,7 @@ stack1 = RasterStack(r1, r2; name=(:r1, :r2)) stack2 = RasterStack(r1a, r2a; name=(:r1, :r2)) dates = [DateTime(2017), DateTime(2018)] ser = RasterSeries([stack1, stack2], Ti(dates)) +@test RasterSeries(DimArray([stack1, stack2],Ti(dates))) == ser @test issorted(dates) @testset "getindex returns the currect types" begin