[GRASS-user] using r.mapcalc

Hello everybody

please help me solving a problem concerning r.mapcalc:
my intention is to calculate a new map consisting of two older ones. the one
shows digitized elements( rocks), cat values are NULL or 1,
the other is a reclassified map(slope >50), with cat values 1 or NULL.
so i have 4 options:
pixels, with only digitized elements, pixels with only slope elements, pixels with both and pixels without(NULL)
the resulting map sould consist of these 4 categories.
i already tried r.patch, but with no success, there was only one resulting category and NULL values.

thanx a lot
thomas
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066

Hi

try just this

new_map="if(map1 && map2, 3, if(map1, 2, 1))"

means:
where both maps are NULL, result will be NULL
where map2 is not null, result will be 1
where map1 is not null, result will be 2
where both maps are not NULL, result will be 3

j

2007/2/9, Thomas Drüssler <Sommes@web.de>:

Hello everybody

please help me solving a problem concerning r.mapcalc:
my intention is to calculate a new map consisting of two older ones. the one
shows digitized elements( rocks), cat values are NULL or 1,
the other is a reclassified map(slope >50), with cat values 1 or NULL.
so i have 4 options:
pixels, with only digitized elements, pixels with only slope elements, pixels with both and pixels without(NULL)
the resulting map sould consist of these 4 categories.
i already tried r.patch, but with no success, there was only one resulting category and NULL values.

thanx a lot
thomas
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

--
Jachym Cepicky
e-mail: jachym.cepicky gmail com
URL: http://les-ejk.cz
GPG: http://www.les-ejk.cz/pgp/jachym_cepicky-gpg.pub

Hello Thomas,

Thomas Drüssler <Sommes@web.de>, [20070209 - 15:52:53]

Hello everybody

please help me solving a problem concerning r.mapcalc:
my intention is to calculate a new map consisting of two older ones.
the one shows digitized elements( rocks), cat values are NULL or 1,
the other is a reclassified map(slope >50), with cat values 1 or
NULL. so i have 4 options:
pixels, with only digitized elements, pixels with only slope
elements, pixels with both and pixels without(NULL) the resulting map
sould consist of these 4 categories. i already tried r.patch, but
with no success, there was only one resulting category and NULL
values.

what about
r.mapcalc "newmap = map1 + map2"

Best
  Stephan

--
Stephan Holl <stephan.holl@intevation.de>, http://intevation.de/~stephan
Tel: +49 (0)541-33 50 8 32 | Intevation GmbH | AG Osnabrück - HR B 18998
Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner

Thomas Drüssler wrote:

please help me solving a problem concerning r.mapcalc:
my intention is to calculate a new map consisting of two older ones. the one
shows digitized elements( rocks), cat values are NULL or 1,
the other is a reclassified map(slope >50), with cat values 1 or NULL.
so i have 4 options:
pixels, with only digitized elements, pixels with only slope elements, pixels with both and pixels without(NULL)
the resulting map sould consist of these 4 categories.
i already tried r.patch, but with no success, there was only one resulting category and NULL values.

  r.mapcalc 'out = !isnull(map1) + 2 * !isnull(map2)'

In general, it's easier to work with 0/1 for "boolean" maps rather
than null/1.

In GRASS, a null value means "no data" or "unknown". IOW, null *isn't*
interpreted as a specific category or value, but as a "marker" for an
unknown value.

E.g. in your second example map, if a value of 1 means that slope>50,
then the "natural" interpretation of a null value is that it is
unknown whether or not slope>50, *not* that slope<=50.

--
Glynn Clements <glynn@gclements.plus.com>

Thomas Drüssler wrote:

Hello everybody

please help me solving a problem concerning r.mapcalc:
my intention is to calculate a new map consisting of two older ones.
the one shows digitized elements( rocks), cat values are NULL or 1,
the other is a reclassified map(slope >50), with cat values 1 or NULL.

so i have 4 options:
pixels, with only digitized elements, pixels with only slope elements,
pixels with both and pixels without(NULL) the resulting map sould
consist of these 4 categories. i already tried r.patch, but with no
success, there was only one resulting category and NULL values.

To the others' explainations I'll add that it is often nice to use
r.support to give your new categories a label / meaning. Then when you
create a legend you don't need to figure out what you meant by "cat 3".

Hamish