<div dir="ltr">Hi <div>I tried also the -z flag.</div><div><br></div><div>I attach the result and the two inputs</div><div><br></div><div><br></div><div>Thanks</div><div><br></div><div>Grazia</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-02-26 13:31 GMT+01:00 Nikos Alexandris <span dir="ltr"><<a href="mailto:nik@nikosalexandris.net" target="_blank">nik@nikosalexandris.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">* Markus Metz <<a href="mailto:markus.metz.giswork@gmail.com" target="_blank">markus.metz.giswork@gmail.com</a><wbr>> [2018-02-26 13:01:35 +0100]:<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Mon, Feb 26, 2018 at 11:19 AM, Gra <<a href="mailto:graziaz@gmail.com" target="_blank">graziaz@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Dear community<br>
<br>
I use r.cross to combine and then reclassify a set of indicators.<br>
<br>
I realised that r.cross doesn't work correctly.<br>
<br>
I have two inputs maps with values from 1 to 3 each.<br>
<br>
<br>
the problem is that r.category doesn't list the first combination (eg 1<br>
</blockquote>
to 1)<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
eg<br>
r.category map=myinput@in_data<br>
</blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
0<br>
1 category 1; category 2<br>
2 category 1; category 3<br>
3 category 2; category 1<br>
4 category 2; category 2<br>
5 category 2; category 3<br>
6 category 3; category 1<br>
7 category 3; category 2<br>
8 category 3; category 3<br>
<br>
in reality the first combination exists (0 is empty but  I should have<br>
</blockquote>
there category 1; category 1)<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
the problem is that I have to iterate on 700 cases and I wont check and<br>
</blockquote>
correct manually.<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
could  you fix it?<br>
</blockquote>
<br>
Please try trunk r72281<br>
</blockquote>
<br></span>
Works for me, thank you.<br>
<br>
I get now (compared to what I've posted in the other post):<br>
<br>
0       CZfg; category 1<br>
1       CZfg; category 2<br>
2       CZbg; category 1<br>
3       CZbg; category 2<br>
4       CZg; category 1<br>
<br>
What about the -z flag, though?<br>
<br>
r.category geology_Test<br>
217     CZfg<br>
405     CZbg<br>
766     CZg<br>
<br>
r.category basins_0_12<br>
0       0<br>
12      Twelve<br>
<br>
r.cross input=geology_Test,basins_0_12 out=cross_Test_6<br>
r.cross input=geology_Test,basins_0_12 out=cross_Test_7 -z<br>
<br>
r.category cross_Test_6<br>
0       CZfg; 0<br>
1       CZfg; Twelve<br>
2       CZbg; 0<br>
3       CZbg; Twelve<br>
4       CZg; 0<br>
<br>
and<br>
<br>
r.category cross_Test_7<br>
0       CZfg; 0<br>
1       CZfg; Twelve<br>
2       CZbg; 0<br>
3       CZbg; Twelve<br>
4       CZg; 0<br>
<br>
<br>
The manual reads:<br>
<br>
With the -z flag zero data values are not crossed. This means that if a<br>
zero category value occurs in any input data layer, the combination is<br>
assigned to category zero in the resulting map layer, even if other data<br>
layers contain non-zero data. In the example given above, use of the -z<br>
option would cause 3 categories to be generated instead of 5.<br>
<br>
By the way, it should be: "In the following example..." and not "In the<br>
example given above...".<br>
<br>
Nikos<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Markus M<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
thanks<br>
Grazia<br>
</blockquote></blockquote>
</blockquote></div><br></div>