<div dir="ltr"><div><br><br>On Mon, Nov 13, 2017 at 11:24 AM, Ken Mankoff <<a href="mailto:mankoff@gmail.com">mankoff@gmail.com</a>> wrote:<br>><br>> Dear GRASS list,<br>><br>> I'm having trouble understanding how to properly use ~r.reclass.area~. It seems to give inconsistent results. I'm using the following MWE to help me figure this out.<br>><br>> Several questions... such as:<br>><br>> Why are the units in hectare instead of m^2?<br><br></div>Most probably for historical reasons (the module comes from GRASS 4).<br><div>><br>> Why is -c and -d mutually exclusive for "mode=reclass" but not "mode=rmarea"?<br></div><div><br></div><div>A bug. They should always be mutually exclusive: either input is already clumped (-c flag), or clumps will be created from the input, considering diagonal neighbours (-d flag).<br></div><div>><br>> Why does mode=rmarea appear to ignore the -d flag<br></div><div><br></div><div>The -d flag only has an effect if clumps are created from the input. If the -c flag is set, the input is already clumped and the -d flag has no effect.  This is (should be) independent of the mode.<br></div><div><br></div><div>><br>> Why does mode=reclass say it cannot find areas <=1 ha, but only if -c is used, and the module never seems to have trouble finding areas of 1 ha otherwise?<br></div><div><br></div><div>Maybe because the input is not clumped?<br></div><div><br></div><div>HTH,</div><div><br></div><div>Markus M<br></div><div>><br>> Thanks,<br>><br>>   -k.<br>><br>><br>> grass72 -c EPSG:3413 ./Gclump.debug<br>> # frink "1 hectare -> m^2" 10,000 m^2<br>> g.region w=0 e=500 s=0 n=500 res=100 -p<br>><br>> debug() { <a href="http://r.out.xyz">r.out.xyz</a> -i input=$@  | cut -d"|" -f3 | xargs -n5; }<br>><br>> r.mapcalc "foo = if(row() == 2 && ((col() > 1) && (col() < 4)) , 1, null())" --o<br>> r.mapcalc "foo = if(row() == 3 && col() == 4, 1, foo)" --o<br>> r.mapcalc "foo = if(row() == 4 && col() == 2, 1, foo)" --o<br>><br>> debug foo<br>> # * * * * *<br>> # * 1 1 * *<br>> # * * * 1 *<br>> # * 1 * * *<br>> # * * * * *<br>><br>> # RMAREA<br>><br>> # simple run with no args<br>> r.reclass.area input=foo output=o value=1 mode=lesser method=rmarea --o --q && debug o<br>> r.reclass.area -c input=foo output=o value=1 mode=lesser method=rmarea --o --q && debug o<br>> # WANT: include diagonal<br>> r.reclass.area -d input=foo output=o value=1 mode=lesser method=rmarea --o --q && debug o<br>> r.reclass.area -d -c input=foo output=o value=1 mode=lesser method=rmarea --o --q && debug o<br>><br>> # All produce the same output:<br>> # * * * * *<br>> # * 1 1 * *<br>> # * * * * *<br>> # * * * * *<br>> # * * * * *<br>><br>> # RECLASS<br>><br>> r.reclass.area input=foo output=o value=1 mode=lesser method=reclass --o --q && debug o<br>> # GOOD: flags areas <=1. Does not consider diagonal:<br>> # * * * * *<br>> # * * * * *<br>> # * * * 1 *<br>> # * 1 * * *<br>> # * * * * *<br>><br>> r.reclass.area -c input=foo output=o value=1 mode=lesser method=reclass --o --q && debug o<br>> # ERROR: "No areas <= 1.000 hectar<br>><br>> r.reclass.area -d input=foo output=o value=1 mode=lesser method=reclass --o --q && debug o<br>> # Appears to work, only areas <=1 flagged, including diagonal<br>> # * * * * *<br>> # * * * * *<br>> # * * * * *<br>> # * 1 * * *<br>> # * * * * *<br>><br>> r.reclass.area -c -d input=foo output=o value=1 mode=lesser method=reclass --o --q && debug o<br>> # ERROR: flags c and d are mutually exclusive<br>><br>> exit<br>> rm -fR  Gclump.debug<br>> _______________________________________________<br>> grass-user mailing list<br>> <a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>> <a href="https://lists.osgeo.org/mailman/listinfo/grass-user">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br><br></div></div>