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

elevation_above_stream_euclidean producing empty tif #35

Closed
erikafreeman opened this issue May 8, 2019 · 4 comments
Closed

elevation_above_stream_euclidean producing empty tif #35

erikafreeman opened this issue May 8, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@erikafreeman
Copy link

I have a script that uses both the elevation_above_stream_euclidean and the elevation_above_stream tools. The inputs are the same.

These are the lines of code:

wbt.elevation_above_stream(dem= path+name+tif, streams= name + '_'+ n + 'streams.tif', output= name + '' + n + 'HAND.tif')

wbt.elevation_above_stream_euclidean(dem= path+name+tif, streams=name + '_' + n + 'streams.tif', output= name + '' + n + 'HANDe.tif')

However, the wbt.elevation_above_stream_euclidean produces an empty .tif without throwing an error.

@erikafreeman
Copy link
Author

and I forgot to mention that the wbt.elevation_above_stream line works.

@jblindsay
Copy link
Owner

@erikafreeman I just tested this tool on a sample DEM that I had and it worked as expected. Can you share your DEM and stream file so that I can try to replicate your issue?

@jblindsay jblindsay added the bug Something isn't working label Nov 7, 2019
@jblindsay
Copy link
Owner

I suspect that this issue was related to the GeoTIFF reader/writer and has now been resolved and so I am closing it. My testing with the tool does not show any issue. If you encounter any further problems, please feel free to re-open it.

@Atreyagaurav
Copy link

Atreyagaurav commented Sep 3, 2023

The problem is not from GeoTIFF, but from the algorithm.

I've mentioned it here: #245

Maybe you ignored it thinking it's the issue from ourside the whitebox tools.

The problem is, the tool masks the value if "streams" raster has no_data values on it. For the streams file normally generated, it's fine as it has 1 for streams and 0 for others, but if you've run it through the ordering algorithms, then it'll have numbers for streams and no_data for others, in that case the algorithm will only output values on the streams and have mostly empty output.

You can find the fix that I purposed at that time on the linked issue. But the code seems to have changed since then, I can open up a pull request with a new code if I can figure out what to change on the new one again.

Here are some files that you can use to replicate it in the latest version. https://drive.google.com/drive/folders/16BPmX8jI8xJGFsKIHcQjioJ2b5Qjx4Ya?usp=sharing

You can try to run it with streams.tif and ordered-streams.tif to see what I mean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants