You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm coding in python and would like to use the feature preserving smoothing filter on my DEM, previously created by idw interpolation. I do not get any error message while running my code but as both hillshade and hillshade smoothed rasters are the same, I suppose the smoothing filter didn't work.
I should specify that when using curvature filters, I was using the same DEM and the results were showing no features (0 value everywhere), so the problem might come from reading the DEM.
Thanks for your help :)
The text was updated successfully, but these errors were encountered:
Laurakhumsup
changed the title
Feature_preserving_smoothing not making any changes
Whitebox-tools: Filters based on DEM reading not working
May 14, 2024
Laurakhumsup
changed the title
Whitebox-tools: Filters based on DEM reading not working
WhiteboxWorkflows: Filters based on DEM reading not working
May 14, 2024
Hi, I'm coding in python and would like to use the feature preserving smoothing filter on my DEM, previously created by idw interpolation. I do not get any error message while running my code but as both hillshade and hillshade smoothed rasters are the same, I suppose the smoothing filter didn't work.
There is my code:
Data reading/writting
AOI_1_DEM_IDW_filled = data_path + 'AOI_1_DEM_TIN.tif'
AOI_1_DEM_IDW_smoothed = data_path + 'AOI_1_DEM_IDW_smoothed.tif'
Feature preserving smoothing
wbt.feature_preserving_smoothing(dem=AOI_1_DEM_IDW_filled,
output=AOI_1_DEM_IDW_smoothed,
filter=21,
norm_diff=25,
num_iter=5
)
Data reading/writting
AOI_1_DEM_IDW_smoothed = data_path + 'AOI_1_DEM_IDW_smoothed.tif'
AOI_1_hillshade_smoothed = data_path + 'AOI_1_hillshade_smoothed.tif'
AOI_1_multi_hillshade_smoothed = data_path + 'AOI_1_multi_hillshade_smoothed.tif'
Multidirectional Hillshade (Four-direction mode)
wbt.multidirectional_hillshade(dem=AOI_1_DEM_IDW_smoothed,
output=AOI_1_multi_hillshade_smoothed,
full_mode=False)
wbt.hillshade(dem=AOI_1_DEM_IDW_smoothed,
output=AOI_1_hillshade_smoothed)
Read the raster using rioxarray
hillshade_smoothed = rxr.open_rasterio(AOI_1_hillshade_smoothed, masked=True)
View the raster
ep.plot_bands(arr=hillshade_smoothed, cmap="binary", figsize=(8, 8), title="Lidar Smoothed Hillshade")
plt.show();
I should specify that when using curvature filters, I was using the same DEM and the results were showing no features (0 value everywhere), so the problem might come from reading the DEM.
Thanks for your help :)
The text was updated successfully, but these errors were encountered: