Skip to content

RasterStack constructor with no rasters cause a stackoverflow #955

@asinghvi17

Description

@asinghvi17

I forgot parens for namedtuple here

julia> precip_cellarea_stack = RasterStack(; precip = precip, cellarea = cellarea(precip))
ERROR: StackOverflowError:
Stacktrace:
 [1] RasterStack(layers::@NamedTuple{}; resize::Rasters.NoKW, _layers::@NamedTuple{}, dims::Tuple{}, refdims::Tuple{}, missingval::@NamedTuple{}, metadata::DimensionalData.Dimensions.Lookups.NoMetadata, layermetadata::@NamedTuple{}, layerdims::@NamedTuple{}, kw::@Kwargs{})
   @ Rasters ~/.julia/dev/geo/Rasters.jl/src/stack.jl:287

but that led to the discovery

julia> RasterStack()
ERROR: StackOverflowError:

whereas

julia> DD.DimStack()
┌ 0-dimensional DimStack ┐
├──────────────── layers ┤
└────────────────────────┘

not sure what's going on here but though it was worth reporting

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions