I am using whitebox tools in R to delineate catchments. I have 150 lakes in a rather small area so many of the lakes are within the same catchment.

I use

wbt_watershed(d8_pntr = ptr,
          pour_pts = pps,
          output = out)

I end up with 150 catchments/sub catchments, so it works just fine. The problem is that the catchments that have nested catchments within them gets cut by the upstream nested catchments.

For example, a lake with 3 other lakes upstream has a rather large catchment including the catchments of all lakes upstream, but since I also delineate the catchments of the three upstream, these sub-catchments are excluded from the primary catchment. The result is that the downstream lake catchment, which in fact has the largest catchment, looses a large part of its area to the nested ones.

Ideally, I want two dataframes, one containing 150 catchments split between primary and subcatchments (as I get now) and one dataframe where each catchment includes the whole lot upstream regardless that there are nested ones included.

I did this in arcmap but I hate that software and I did this manually for one catchment with 4 nested subcatchments, which clearly is not feasible now because I have 150 catchments in a big, messy cluster.

Primary catchment

This is a primary catchment, nr 23, which has nr 22 nested within it. The area of 23 should also include 22, but in the whitebox output the subcatchment extent is subtracted from it.

Is there any effective way of solving this in this dataset?

1 Answer 1


This scenario is precisely what the WhiteboxTools UnnestBasins tool is used for. The tool documentation states:

In some applications it is necessary to relate a measured variable for a group of hydrometric stations (e.g. characteristics of flow timing and duration or water chemistry) to some characteristics of each outlet's catchment (e.g. mean slope, area of wetlands, etc.). When the group of outlets are nested, i.e. some stations are located downstream of others, then performing a watershed operation will result in inappropriate watershed delineation. In particular, the delineated watersheds of each nested outlet will not include the catchment areas of upstream outlets. This creates a serious problem for this type of application.

The Unnest Basin tool can be used to perform a watershedding operation based on a group of specified pour points, i.e. outlets or target cells, such that each complete watershed is delineated.

Note that the tool will actually output multiple watershed rasters, with the number of rasters equal to the maximum level of outlet nesting. And so your full watersheds will be spread across a number of output rasters. The outlet ID value (or lake ID in your case) can be used to associate a particular watershed to a lake.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.