[GRASS-user] Shell scripting basic issues

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...

Thanks!

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Shell-scripting-basic-issues-tp4996287.html
Sent from the Grass - Users mailing list archive at Nabble.com.

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

hope this helps,
Markus