Fill_depressions error

28 views
Skip to first unread message

Eduardo Bueno Alfaro

unread,
Dec 16, 2022, 11:44:06 AM12/16/22
to WhiteboxTools
I just installed and activated whitebox workflows.
I want to fill a dem, my code:

import whitebox_workflows
wbe = whitebox_workflows.WbEnvironment()
dem= "file.tif"
wbe.fill_depressions(
    dem,
    "output.tif",
    fix_flats=True,
    flat_increment=None,
    max_depth=None,
    callback=None
)

The script returns an error: "TypeError: WbEnvironment.fill_depressions() got multiple values for argument 'fix_flats'"

Why? can someone help me?
Thanks

Whitebox Geospatial

unread,
Dec 16, 2022, 6:08:37 PM12/16/22
to Eduardo Bueno Alfaro, WhiteboxTools

Hello Eduardo,

 

Welcome to Whitebox Workflows for Python (WbW)! Okay, so it looks to me like you are using the WhiteboxTools signature for this particular tool but WbW uses different function signatures than WhiteboxTools. This is because unlike WhiteboxTools, with WbW you directly pass each function a data object (raster, vector, lidar) and the function similarly outputs a data object. There is also no need for the callback function in WbW. 

Here is a listing of tool function signatures for WbW and you should find the equivalent fill_depressions function:

https://www.whiteboxgeo.com/manual/wbw-user-manual/book/list-of-tool-signatures.html

 

In fact, if you are using a typical IDE for developing your script (e.g. VS Code), then you should see autocomplete as soon as you type the function:

Screenshot 2022-12-16 at 11.56.41 AM.png

 

For more information on using WbW, please take a look at the user manual, available here:

https://www.whiteboxgeo.com/manual/wbw-user-manual/book/preface.html

 

All the best,

 

John


--
You received this message because you are subscribed to the Google Groups "WhiteboxTools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to whiteboxtool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/whiteboxtools/9b9da689-2666-4f08-b174-7ea0554c4328n%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages