pysheds icon indicating copy to clipboard operation
pysheds copied to clipboard

How to create a raster delineating all drainage basins using pysheds.

Open rrsc1234 opened this issue 4 years ago • 3 comments

Hi. I want to create a raster delineating all drainage basins similar to that as present in ArcMap (Basin Tool under Hydrology Tool). Can someone let me know whether is there any way of doing this using this pyshed library.

rrsc1234 avatar Nov 27 '20 15:11 rrsc1234

Try to use snap_to_mask.ipynb.

  • Pick up points that are inside your watershell (you can try use the random sampling like the example)
  • Convert z1 to Geojson/Shapefile (search how to convert tiff to Geojson )
  • The outer limit will be your calculated watershed

bmalbusca avatar Apr 25 '21 11:04 bmalbusca

This is indeed a separate function in ArcGIS (which I didn't have until a few months ago, lol): https://pro.arcgis.com/en/pro-app/latest/tool-reference/spatial-analyst/basin.htm

The key seems to be this:

The drainage basins are created by locating the pour points at the edges of the analysis window (where water would pour out of the raster), as well as sinks, then identifying the contributing area above each pour point.

So basically, they just delineate (and label) a set of drainage basins at each pixel where the flow direction points outside the boundary of the raster. I could write a wrapper function around grid.catchment to do this.

mdbartos avatar Jan 04 '22 02:01 mdbartos

this would be a neaty and much-needed function. Looking forward to it

pkmn99 avatar Oct 13 '23 14:10 pkmn99