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

WhiteboxWorkflows: Filters based on DEM reading not working #406

Open
Laurakhumsup opened this issue May 14, 2024 · 0 comments
Open

WhiteboxWorkflows: Filters based on DEM reading not working #406

Laurakhumsup opened this issue May 14, 2024 · 0 comments

Comments

@Laurakhumsup
Copy link

Laurakhumsup commented 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 :)

@Laurakhumsup Laurakhumsup changed the title Feature_preserving_smoothing not making any changes Whitebox-tools: Filters based on DEM reading not working May 14, 2024
@Laurakhumsup Laurakhumsup changed the title Whitebox-tools: Filters based on DEM reading not working WhiteboxWorkflows: Filters based on DEM reading not working May 14, 2024
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

No branches or pull requests

1 participant