<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ccccff" text="#000000">
try<br>
r.cross (Raster>Overlay Rasters>Cross product) for a
cross-classification map <br>
and <br>
r.coin (Raster>Reports and Statistics>Mutual category
occurrences) for cross tabulation <br>
also r.kappa (Imagery>Reports and statistics>Kappa Analysis)
for a comparison <br>
<br>
cheers,<br>
s.<br>
<br>
On 07/22/2011 01:41 PM, Hermann Peifer wrote:
<blockquote cite="mid:4E2953F3.4050200@gmx.eu" type="cite">Hi,
<br>
<br>
I have 2 Corine Land Cover (CLC) raster maps, from 2000 and 2006.
Both maps have the same extent, the same resolution (100m) and use
the same 44 CLC categories. The maps are pretty large: 67 000 cols
x 58 000 rows = 3 886 000 000 cells.
<br>
<br>
I'd like to categorise the changes between the 2 layers, according
to a decision matrix which I pasted below [1]. Row headers
indicate the clc2000 category, column headers represent the
clc2006 category. I only pasted the "left half" of the table in
order to avoid ugly line breaks.
<br>
<br>
<br>
Question:
<br>
Is there a better (and faster) way than doing this comparison by
using r.mapcalc with a (nearly) endless if/else chain [2] ?
<br>
<br>
I also noted that in 99+ % of the cases, both maps are NULL or
have an identical CLC category, so I wouldn't need the if/else
chain at all. I guess I can use this fact to shortcut the
comparison?
<br>
<br>
<br>
Thanks in advance, Hermann
<br>
(using GRASS 6.4 on 64-bit Debian Linux)
<br>
<br>
[1]
<br>
<br>
## 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
22 ..
<br>
1 NA 12 31 32 33 34 35 36 37 13 38 56 56 56 56 56 56 56 56 56 56
56 ..
<br>
2 11 NA 31 32 33 34 35 36 37 13 38 56 56 56 56 56 56 56 56 56 56
56 ..
<br>
3 12 12 NA 32 33 34 35 36 37 13 38 56 56 56 56 56 56 56 56 56 56
56 ..
<br>
4 12 12 31 NA 33 34 35 36 37 13 38 56 56 56 56 56 56 56 56 56 56
56 ..
<br>
5 12 12 31 32 NA 34 35 36 37 13 38 56 56 56 56 56 56 56 56 56 56
56 ..
<br>
6 12 12 31 32 33 NA 35 36 37 13 38 56 56 56 56 56 56 56 56 56 56
56 ..
<br>
7 12 12 31 32 33 34 NA 36 37 13 38 56 56 56 56 56 56 56 56 56 56
56 ..
<br>
8 12 12 31 32 33 34 35 NA 37 13 38 56 56 56 56 56 56 56 56 56 56
56 ..
<br>
9 12 12 31 32 33 34 35 36 NA 13 38 56 56 56 56 56 56 56 56 56 56
56 ..
<br>
10 11 11 31 32 33 34 35 36 37 NA 38 56 56 56 56 56 56 56 56 56 56
56 ..
<br>
11 11 11 31 32 33 34 35 36 37 13 NA 56 56 56 56 56 56 56 56 56 56
56 ..
<br>
12 21 22 31 32 33 34 35 36 37 13 38 NA 45 43 42 42 42 41 42 41 83
61 ..
<br>
13 21 22 31 32 33 34 35 36 37 13 38 43 NA 43 42 42 42 41 42 41 83
61 ..
<br>
14 21 22 31 32 33 34 35 36 37 13 38 43 43 NA 42 42 42 41 42 41 83
61 ..
<br>
15 21 22 31 32 33 34 35 36 37 13 38 45 45 45 NA 44 44 41 45 45 83
61 ..
<br>
16 21 22 31 32 33 34 35 36 37 13 38 45 45 45 44 NA 44 41 45 45 83
61 ..
<br>
17 21 22 31 32 33 34 35 36 37 13 38 45 45 45 44 44 NA 41 45 45 83
61 ..
<br>
18 21 22 31 32 33 34 35 36 37 13 38 45 45 45 42 42 42 NA 45 45 83
61 ..
<br>
19 21 22 31 32 33 34 35 36 37 13 38 45 45 45 42 42 42 41 NA 41 83
61 ..
<br>
20 21 22 31 32 33 34 35 36 37 13 38 45 45 45 42 42 42 41 45 NA 83
61 ..
<br>
21 21 22 31 32 33 34 35 36 37 13 38 52 52 52 52 52 52 41 52 54 NA
54 ..
<br>
22 21 22 31 32 33 34 35 36 37 13 38 45 45 45 42 42 42 41 45 45 83
NA ..
<br>
23 21 22 31 32 33 34 35 36 37 13 38 51 51 51 51 51 51 53 51 53 53
53 ..
<br>
24 21 22 31 32 33 34 35 36 37 13 38 51 51 51 51 51 51 53 51 53 53
53 ..
<br>
25 21 22 31 32 33 34 35 36 37 13 38 51 51 51 51 51 51 53 51 53 53
53 ..
<br>
26 21 22 31 32 33 34 35 36 37 13 38 52 52 52 52 52 52 54 52 54 54
54 ..
<br>
27 21 22 31 32 33 34 35 36 37 13 38 52 52 52 52 52 52 54 52 54 54
54 ..
<br>
28 21 22 31 32 33 34 35 36 37 13 38 52 52 52 52 52 52 54 52 54 54
54 ..
<br>
29 21 22 31 32 33 34 35 36 37 13 38 52 52 52 52 52 52 54 52 54 54
54 ..
<br>
30 21 22 31 32 33 34 35 36 37 13 38 52 52 52 52 52 52 54 52 54 54
53 ..
<br>
31 21 22 31 32 33 34 35 36 37 13 38 52 52 52 52 52 52 54 52 54 54
53 ..
<br>
32 21 22 31 32 33 34 35 36 37 13 38 52 52 52 52 52 52 54 52 54 54
53 ..
<br>
33 21 22 31 32 33 34 35 36 37 13 38 52 52 52 52 52 52 54 52 54 54
53 ..
<br>
34 NA NA NA NA NA NA NA NA NA NA 38 NA NA NA NA NA NA NA NA NA NA
NA ..
<br>
35 21 22 31 32 33 34 35 36 37 13 38 55 55 55 55 55 55 55 55 55 55
55 ..
<br>
36 21 22 31 32 33 34 35 36 37 13 38 55 55 55 55 55 55 55 55 55 55
55 ..
<br>
37 21 22 31 32 33 34 35 36 37 13 38 55 55 55 55 55 55 55 55 55 55
55 ..
<br>
38 21 22 31 32 33 34 35 36 37 13 38 55 55 55 55 55 55 55 55 55 55
55 ..
<br>
39 21 22 31 32 33 34 35 36 37 13 38 55 55 55 55 55 55 55 55 55 55
55 ..
<br>
40 21 22 31 32 33 34 35 36 37 13 38 55 55 55 55 55 55 55 55 55 55
55 ..
<br>
41 21 22 31 32 33 34 35 36 37 13 38 55 55 55 55 55 55 55 55 55 55
55 ..
<br>
42 21 22 31 32 33 34 35 36 37 13 38 55 55 55 55 55 55 55 55 55 55
55 ..
<br>
43 21 22 31 32 33 34 35 36 37 13 38 55 55 55 55 55 55 55 55 55 55
55 ..
<br>
44 21 22 31 32 33 34 35 36 37 13 38 55 55 55 55 55 55 55 55 55 55
55 ..
<br>
<br>
<br>
[2]
<br>
<br>
change = \
<br>
clc2000 == 1 && clc2006 == 2 ? 12 : \
<br>
clc2000 == 1 && clc2006 == 3 ? 31 : \
<br>
clc2000 == 1 && clc2006 == 4 ? 32 : \
<br>
clc2000 == 1 && clc2006 == 5 ? 33 : \
<br>
clc2000 == 1 && clc2006 == 6 ? 34 : \
<br>
clc2000 == 1 && clc2006 == 7 ? 35 : \
<br>
clc2000 == 1 && clc2006 == 8 ? 36 : \
<br>
clc2000 == 1 && clc2006 == 9 ? 37 : \
<br>
clc2000 == 1 && clc2006 == 10 ? 13 : \
<br>
<br>
... (snip away some 1700 if/else rules)
<br>
<br>
clc2000 == 44 && clc2006 == 30 ? 89 : \
<br>
clc2000 == 44 && clc2006 == 31 ? 89 : \
<br>
clc2000 == 44 && clc2006 == 32 ? 89 : \
<br>
clc2000 == 44 && clc2006 == 35 ? 82 : \
<br>
clc2000 == 44 && clc2006 == 36 ? 82 : \
<br>
clc2000 == 44 && clc2006 == 37 ? 82 : \
<br>
clc2000 == 44 && clc2006 == 38 ? 89 : \
<br>
clc2000 == 44 && clc2006 == 39 ? 89 : \
<br>
clc2000 == 44 && clc2006 == 42 ? 82 : \
<br>
clc2000 == 44 && clc2006 == 43 ? 82 : 0
<br>
_______________________________________________
<br>
grass-user mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a>
<br>
<br>
</blockquote>
<br>
</body>
</html>