Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue: ElevationAboveStreamEuclidean Produces Empty TIFF #376

Open
Heljor opened this issue Aug 25, 2023 · 1 comment · May be fixed by #377
Open

Issue: ElevationAboveStreamEuclidean Produces Empty TIFF #376

Heljor opened this issue Aug 25, 2023 · 1 comment · May be fixed by #377

Comments

@Heljor
Copy link

Heljor commented Aug 25, 2023

Issue: ElevationAboveStreamEuclidean Produces Empty TIFF

When executing the elevation_above_stream_euclidean function, the resulting DEM outputs an empty .tif file.

Steps to Reproduce:

# Modify no data value
wbt.modify_no_data_value(
    i="dem.tif",
    new_value="0.0"


)

# Breach single cell pits
wbt.breach_single_cell_pits(
    dem="dem.tif",
    output="breach_single_cell_pits.tif"
)

# Fill depressions using Wang and Liu's method
wbt.fill_depressions_wang_and_liu(
    dem="breach_single_cell_pits.tif",
    output="filldepress.tif",
    fix_flats=True,
    flat_increment=None
)

# D8 pointer
wbt.d8_pointer(
    dem="filldepress.tif",
    output="D8Pointer.tif",
    esri_pntr=True
)

# D8 flow accumulation
wbt.d8_flow_accumulation(
    i="D8Pointer.tif",
    output="D8FlowAccumulation.tif",
    out_type="specific contributing area",
    log=False,
    clip=False,
    pntr=True,
    esri_pntr=True
)

# Extract stream
wbt.extract_streams(
    flow_accum="D8FlowAccumulation.tif",
    output="extractstream.tif",
    threshold="1000",
    zero_background=False
)

# Elevation above stream Euclidean
wbt.elevation_above_stream_euclidean(
    dem="breach_single_cell_pits.tif",
    streams="extractstream.tif",
    output="elevation_above_stream_euclidean.tif"
)

resulting_novalue_tiff

@Atreyagaurav
Copy link

I don't know why this has been ignored for so long, this was due to the code masking the output value from the streams raster's no_data instead of input DEM's.

Here is my original issue with a patch: #245

But you'd have to compile it. And looks like the code has been changed, so you can't apply that patch to the new version automatically. Hopefully it'll be fixed.

Atreyagaurav added a commit to Atreyagaurav/whitebox-tools that referenced this issue Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants