-
Notifications
You must be signed in to change notification settings - Fork 4
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
Ignoring nodata values #36
Comments
The dataset that malstroem was developed to handle does not have nodata values, so malstroem does not have a special case for nodata values. I am curious to know what you mean by "ignored"? Should nodata cells act as a barrier or a sink, or something else? Regards Asger |
Thanks for your quick reply. My DEM has been preprocessed to assign nodata values to large water bodies as these areas are not "hydro-enforced" - the lidar-derived elevations represent the water surface which often contains anomalies from waves or sparsely interpolated ground points on the shorelines. Nodata values should thus be ignored (masked) and not be considered in the calculations. I would love to gain some insight on how best to deal with these cases and would appreciate any recommendations or preprocessing steps that you may suggest based on your experience. |
As I understand it water should be allowed to flow into nodata cells where it should disappear from the model. As of now, this functionality is not supported by the Malstroem command line tools. However, I think it should be relatively straightforward to implement this feature either by modifying the code directly or if you are using Malstroem as a Python module. Unfortunately, I'm currently tied up with other projects, so I won't be able to work on this myself in the foreseeable future. A good starting point would be to modify _initialize_filled to set nodata cells to some constant value (must be lower than any valid DTM cell value). Then modify _fill_cell_no_flats to not modify the value of cells with this constant value. Remember that if you are using "speedups" then the code in https://github.com/Septima/malstroem/blob/master/malstroem/algorithms/speedups/_fill.pyx must be changed to use this approach too. |
Thanks again the explanation and suggestion. Is the dataset that the package was developed for publicly available? If not, could you explain any preprocessing steps or how water bodies are represented? |
The dataset is free and open. It is called "DHM/Terræn" and can be downloaded from here https://dataforsyningen.dk/ after creation of a free account. The site is only available in Danish. The specification is in english: https://dataforsyningen.dk/asset/PDF/produkt_dokumentation/dhm-prodspec-v1.0.0.pdf Basically water bodies are assigned a constant elevation as part of the processing at the agency. |
Hi,
When testing the sample usage command
malstroem complete -mm 20 -filter "maxdepth > 0.05" -dem dem.tif -outdir c:\outputdirectory -zresolution 0.2
on my data which has nodata assigned to -99999 the code executes, but the nodata values seem to be treated as valid areas and processed as such.How can I ensure that nodata values are ignored?
Thanks!
The text was updated successfully, but these errors were encountered: