[GRASS5] r.mapcalc: Neighborhood cell index

Dear developers,

a question related to r.mapcalc's scheme of neighborhood cell index:

In Larson, Shapiro, Tweddale, 1991, "Performing Map Calculations on GRASS
Data: r.mapcalc Programa Tutorial", 3.5. Neighborhood modifiers, p.8.
http://grass.itc.it/gdp/raster/mapcalc.pdf

is written:
"format is map[r,c],..."
"map[1,2] refers to one row below and two columns to the right..."

That means:
map[y,x] with x positive to "East" and y positive to "South".

For curiousity: Is there a particular reason to have the orientation
pointing positive to South?

Markus

On Tue, 18 Feb 2003, Markus Neteler wrote:

Dear developers,

a question related to r.mapcalc's scheme of neighborhood cell index:

In Larson, Shapiro, Tweddale, 1991, "Performing Map Calculations on GRASS
Data: r.mapcalc Programa Tutorial", 3.5. Neighborhood modifiers, p.8.
http://grass.itc.it/gdp/raster/mapcalc.pdf

is written:
"format is map[r,c],..."
"map[1,2] refers to one row below and two columns to the right..."

That means:
map[y,x] with x positive to "East" and y positive to "South".

For curiousity: Is there a particular reason to have the orientation
pointing positive to South?

Because rows start at 0 at the northern edge? Then the n/s offsets would
work without reversal?

Roger

--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand@nhh.no

Markus Neteler wrote:

a question related to r.mapcalc's scheme of neighborhood cell index:

In Larson, Shapiro, Tweddale, 1991, "Performing Map Calculations on GRASS
Data: r.mapcalc Programa Tutorial", 3.5. Neighborhood modifiers, p.8.
http://grass.itc.it/gdp/raster/mapcalc.pdf

is written:
"format is map[r,c],..."
"map[1,2] refers to one row below and two columns to the right..."

That means:
map[y,x] with x positive to "East" and y positive to "South".

For curiousity: Is there a particular reason to have the orientation
pointing positive to South?

I don't know the original reason[1], but the reason why it's that way
now is because that's the way it's always been, and changing it would
break anything that uses a row modifier.

[1] However, one plausible explanation is that cell grids (matrices,
bitmap images etc) conventionally have their origin in the top-left
corner. E.g. mathematics textbooks show matrices with the (0,0)
element in the top-left corner, most[2] bitmap image formats start
with the top-left pixel. In turn, this probably has something to do
with the fact that western languages are written left-to-right,
top-to-bottom.

[2] Except, for some reason, the Windows' BMP format normally starts
with the bottom-left pixel. Also, TGA supports multiple orientations
(can be "flipped" in the X and/or Y axes).

--
Glynn Clements <glynn.clements@virgin.net>