Hi, I'm currently exploring the GRASS capabilities for shell scripting. After
the first steps I found that I don't see how to do some basic stuff.
For example: Is there a way to access the matrix of cell values of a raster
to get those values? If I were operating GRASS directly, I'd use r.what...
but here I don't use coordinates, I want to get the cell values by its
matrix positions.
I have more doubts, but if I can't make this work...
On Mon, Aug 20, 2012 at 11:17 AM, DavidRA <theboss777@gmail.com> wrote:
For example: Is there a way to access the matrix of cell values of a raster
to get those values?
Yes.
If I were operating GRASS directly, I'd use r.what...
but here I don't use coordinates, I want to get the cell values by its
matrix positions.
You can use x() and y() of r.mapcalc: http://grass.osgeo.org/grass64/manuals/html64_user/r.mapcalc.html
Internal variables:
row() current row of moving window
col() current col of moving window
x() current x-coordinate of moving window
y() current y-coordinate of moving window
ewres() current east-west resolution
nsres() current north-south resolution
null() NULL value