I'm currently trying for an automated solution to delineate watersheds within a large basin. I have a collection of locations (X,Y coords) for various tributaries reaching a larger river, and the end-game is to have each sub-basin delineated so I can calculate areas etc. I have been working in R, using SAGA and the RSAGA packages, (R 3.2.2, SAGA 2.1.2, OSX Yosemite 10.10.5).

So far, I have been able to fill the sinks:

rsaga.fill.sinks('dem_saga.sgrd', 'dem_sinkfilled.sgrd', method = "xxl.wang.liu.2006")

And have been able to make a raster of the same size and resolution as the dem, where all cells are 'NA' except for a single cell at the desired location to delineate the watershed (target.sgrd). This was achieved using rasterize command in R (e.g. rasterize(target_point, dem, 1)).

Unfortunately, although I am pretty sure the command I want is the 'Upslope Area' module, when it runs, I end up with a raster where every cell = 100.

I'm not sure exactly how to make a reproducible example, but my code:

rsaga.geoprocessor(lib = 'ta_hydrology', 4,
                    param = list(TARGET = 'target.sgrd',
                                 ELEVATION = 'dem_sinkfilled.sgrd',
                                 AREA = 'target_catch.sgrd',
                                 METHOD = 0))

Finally, the tutorial I have been working through is here. Jumping down to "Creating a Watershed map".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.