[GRASS-user] r.mapcalc results have 'categories'

Ken Mankoff mankoff at gmail.com
Mon Jan 4 18:28:51 PST 2016


Hi list,

I'm now trying to use r.watershed instead of r.terraflow. It works with my surface DEM, but I want to use a different 'cost' function as my surface instead of the actual land surface. I generate this cost function with:

r.mapcalc 'phi = (1000 * 9.8 * bed + 917 * 9.8 * (surf - bed))'

Even before r.watershed (which works on bed and surf but not on phi), I notice phi is different in two ways:

1) phi has 'categories'

r.info bed | grep Cat
r.info surf | grep Cat
r.info phi | grep Cat
 |   Type of Map:  raster               Number of Categories: 0               |
 |   Type of Map:  raster               Number of Categories: 0               |
 |   Type of Map:  raster               Number of Categories: 255             |

2) when I display (d.erase; d.rast bed; d.legend map=bed) bed or surf, the colorbar is green->blue->red (top-mid-bottom) and numbers are low->high (top->bottom). When I display phi, the order is reversed.

When I run r.watershed, it appears to work, but the results are garbage. flow directions are all E or W (not 8-directions as the same command generates w/ surf or bed), etc. But I assume these r.watershed issues are secondary.

Can someone help clarify what is going on? I'm happy to provide a full script w/ wget to access the data if it helps.

Thanks,

  -k.


More information about the grass-user mailing list