<div dir="ltr"><div><div><br><br>On Mon, Feb 26, 2018 at 1:31 PM, Nikos Alexandris <<a href="mailto:nik@nikosalexandris.net">nik@nikosalexandris.net</a>> wrote:<br>><br>> * Markus Metz <<a href="mailto:markus.metz.giswork@gmail.com">markus.metz.giswork@gmail.com</a>> [2018-02-26 13:01:35 +0100]:<br>><br>>> On Mon, Feb 26, 2018 at 11:19 AM, Gra <<a href="mailto:graziaz@gmail.com">graziaz@gmail.com</a>> wrote:<br>>>><br>>>><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>>><br>>> to 1)<br>>>><br>>>><br>>>> eg<br>>>> r.category map=myinput@in_data<br>>><br>>><br>>>> 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>>><br>>> there category 1; category 1)<br>>>><br>>>> the problem is that I have to iterate on 700 cases and I wont check and<br>>><br>>> correct manually.<br>>>><br>>>><br>>>> could  you fix it?<br>>><br>>><br>>> Please try trunk r72281<br>><br>><br>> Works for me, thank you.<br>><br>><br>> What about the -z flag, though?<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></div>The -z flag does not behave as explained in the manual. It comes from the old days when there was no NULL encoding in GRASS, and zero was used as nodata. Now the -z flag means that with the -z flag, NULL values are not crossed, not that zero data are not crossed. This has been introduced in 2013 with r55276. The results of r.cross without the -z flag might look strange if any of the input maps contains NULL cells.<br><br></div>Markus M<br><div><div>><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>>> Markus M<br>>><br>>>> thanks<br>>>> Grazia<br><br></div></div></div>