I need to know exact way how stream power index (SPI) is computed by module r.watershed. On the help page is that SPI is α * tan(β), where:

α is cumulative upslope area draining through a point per unit contour length


tan(β) is the local slope angle.

So I tried to make an example digital elevation model (DEM) to confirm my computation "by hand" and numbers computed by r.watershed. So I made 1 000 meters long and 200 meters width DEM, where upper pixels has 150 meters above sea level and lower pixel has 100 m.a.s.l. So slope at this example dem is 5% or 2.862°. Pixel resolution is 5 x 5 meters.

As α I consider flow acummulation (also computed by r.watershed) and I want to compute SPI value for very last pixel in flow direction (pixel with 100 m.a.s.l.). Flow accumulation number was 198,5. So, by pixel resolution 25 square meters, cumulative upslope area is 198,5 * 25 = 4962.5 square meters.

As β I take slope in degrees, so 2,862°. Therefore, tan(β) is 0,0499.

By the equation on the help page, SPI = 4962.5 * 0,0499 = 148.875.

But value from SPI raster is 16.51.

I tried to find some explanation, but I can't find anything. I also try to find something in source code, but its pretty hard for me.

Do somebody know where can I find some additional info about how is SPI computed? I assumed that point of my question is hidden in α value, but I can't figured it out.

enter image description here

  • Would you mind to open a bug report for this? Either the computation or the manual are apparently not consistent. Your example is very useful. Please open a ticket at trac.osgeo.org/grass
    – markusN
    Jun 17, 2018 at 18:33


Your Answer

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

Browse other questions tagged or ask your own question.