Skip to content

Flow Accumulation: 0 accumulation vs. invalid/nodata cells #263

@szwiep

Description

@szwiep

When computing flow accumulation with the accumulation method, the output seems to represent accumulation+1 for each cell. iiuc, this is because _sgrid._d8_accumulation_iter_numba guarantees that every valid cell gets at least one point of accumulation, even if it's endnode is itself. Nodata/invalid cells are set to 0 earlier in the callstack . It seems that min accumulation=1 helps to differentiate the nodata from valid cells in the output.

However, having min accumulation=1 results in accumulation rasters that are different than rasters from other tools like ArcGIS, QGIS, Whitebox Tools. For those tools, the min accumulation=0. To support interoperability between tools, I'd like to suggest some parameter (or tweak to the loop) that would allow for definition of a non-0 nodata, and a min flow accumulation of 0.

I'd be happy to push up a PR if you think it's a reasonable addition to the tool!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions