[GRASSLIST:3347] r.mapcalc problem

Emiliano Giovanni Vavassori testina at sssup.it
Tue May 4 18:34:28 EDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,
My name is Emiliano and I'm an Agricultural Sciences student from Italy.
GIS will eventually be useful to my profession, so I am trying to learn
how to use this tool for territorial analysis. I read the GRASS Seeds
tutorial by ASSIST and the GRASS Tutorial by M.Lennert, but maybe
there's something (that) I don't understand with r.mapcalc.
I tested GRASS 5.0.2, 5.0.3 and 5.3 on my Gentoo Linux Box, compiled
from sources and ebuild to try to understand what the problem could be.
I have also tried on a Debian Linux box with GRASS 5.0.3 with no
positive results.
The problem I am experiencing with GRASS is related to simple algebra
map operations such as '+' and '-'. On page B-13 of the GRASS Seeds
tutorial, the subsequent step is required:

~   r.mapcalc 'buffers = mwaybuf + railbuf' <enter>

(well, the tutorial requires interactive mode, but that doesn't
matter---I still have the same problem). At that time, the 'mwaybuf'
raster map contains only a category, with number 1, that represents a
buffer zone around a motorway. 'railbuf' also represents a buffer with
category 2, but around railways. In those cases, the rest of the maps
are 'no data' cells. My guess is that with a map addition I should
expect to have a 'buffers' raster map that contains all buffers, marked
with two different colours (if displayed with d.rast) and as well, in
r.report there should be 2 categories, but what I obtain is an empty
'buffers' map, where all cells are marked 'no data'.
What also seems strange is that '-' operation on MASK (page B-16 of the
same tutorial) results in an intersection (a logic AND) between two
marked maps.
I also read 'Performing Map Calculations on GRASS Data: r.mapcalc
Program Tutorial' by M.Larson, M.Shapiro and S.Tweddale and 'r.mapcalc
An Algebra for GIS and Image Processing' by M.Shapiro and J.Westervelt,
but I did not learn anything that I did not know before.
What I am trying to understand is whether I should submit a bug
report or whether I'm missing something about r.mapcalc operations.
Thank you in advance, I hope my post wasn't too long.

PS: I will paste here the r.report outputs of the three mentioned maps
and ./configure options I used to compile grass-5.3 on my Gentoo box.

*~~~~~~~~~~~~~~~~*

GRASS:~ > r.report mwaybuf units=cell
r.stats:  100%
+-----------------------------------------------------------------------------+
|                         RASTER MAP CATEGORY REPORT
~      |
|LOCATION: leics                                      Fri Apr 30
22:07:57 2004|
|-----------------------------------------------------------------------------|
|          north: 322000    east: 456000
~      |
|REGION    south: 310000    west: 444000
~      |
|          res:       50    res:      50
~      |
|-----------------------------------------------------------------------------|
|MASK:none
~      |
|-----------------------------------------------------------------------------|
|MAP: M1 Motorway Buffer Zone (mwaybuf in PERMANENT)
~      |
|-----------------------------------------------------------------------------|
|                         Category Information
| cell|
|#|description
|count|
|-----------------------------------------------------------------------------|
|1|1000m_around_m1. . . . . . . . . . . . . . . . . . . . . . . . . . .
|10237|
|*|no data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|47363|
|-----------------------------------------------------------------------------|
|TOTAL
|57600|
+-----------------------------------------------------------------------------+
GRASS:~ >

*~~~~~~~~~~~~~~~~*

GRASS:~ > r.report railbuf units=cell
r.stats:  100%
+-----------------------------------------------------------------------------+
|                         RASTER MAP CATEGORY REPORT
~      |
|LOCATION: leics                                      Fri Apr 30
22:08:40 2004|
|-----------------------------------------------------------------------------|
|          north: 322000    east: 456000
~      |
|REGION    south: 310000    west: 444000
~      |
|          res:       50    res:      50
~      |
|-----------------------------------------------------------------------------|
|MASK:none
~      |
|-----------------------------------------------------------------------------|
|MAP: Rail Buffer Zone (railbuf in PERMANENT)
~      |
|-----------------------------------------------------------------------------|
|                         Category Information
| cell|
|#|description
|count|
|-----------------------------------------------------------------------------|
|2|1000m_around_rail. . . . . . . . . . . . . . . . . . . . . . . . . .
|10347|
|*|no data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|47253|
|-----------------------------------------------------------------------------|
|TOTAL
|57600|
+-----------------------------------------------------------------------------+
GRASS:~ >

*~~~~~~~~~~~~~~~~*

GRASS:~ > r.report buffers units=cell
r.stats:  100%
+-----------------------------------------------------------------------------+
|                         RASTER MAP CATEGORY REPORT
~      |
|LOCATION: leics                                      Fri Apr 30
22:13:17 2004|
|-----------------------------------------------------------------------------|
|          north: 322000    east: 456000
~      |
|REGION    south: 310000    west: 444000
~      |
|          res:       50    res:      50
~      |
|-----------------------------------------------------------------------------|
|MASK:none
~      |
|-----------------------------------------------------------------------------|
|MAP: (untitled) (buffers in PERMANENT)
~      |
|-----------------------------------------------------------------------------|
|                         Category Information
| cell|
|#|description
|count|
|-----------------------------------------------------------------------------|
|*|no data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|57600|
|-----------------------------------------------------------------------------|
|TOTAL
|57600|
+-----------------------------------------------------------------------------+
GRASS:~ >

*~~~~~~~~~~~~~~~~*

./configure --host=i686-pc-linux-gnu --prefix=/opt --with-blas
- --with-lapack --without-postgres --with-tctk --with-gd --without-odbc
- --with-motif --with-motif-includes=/usr/X11R6/include --with-freetype
- --with-nls --with-x --without-gdal

- --

________________________________________________
Emiliano Giovanni Vavassori
Allievo Ordinario - Settore di Scienze Agrarie
Scuola Superiore di Studi Universitari e di Perfezionamento
"Sant'Anna"

Homepage:	http://syntaxerrormmm.altervista.org/
Chiave pubblica GPG:
http://syntaxerrormmm.altervista.org/dwls/personal/testina.asc

GuIT --- Gruppo Utilizzatori Italiani TeX
~     --- Italian Official TUG ---
Home page: http://www.guit.sssup.it/

Per favore, non inviatemi allegati in formato Word o PowerPoint.
Si veda: http://www.fsf.org/philosophy/no-word-attachments.it.html


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFAmBp094fVpJPtJ6oRApePAJ4gJgcV+MhfLhwZam+3qPYbbth/xACfWCZm
S4lX4R2pnjcT/DDsVmUKqPM=
=w7jX
-----END PGP SIGNATURE-----




More information about the grass-user mailing list