<div dir="ltr"><div><br><br>On Wed, Apr 26, 2017 at 12:03 PM, Moritz Lennert <<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>> wrote:<br>><br>> On 25/04/17 22:14, Markus Metz wrote:<br>>><br>>><br>>> On Tue, Apr 25, 2017 at 3:31 PM, Moritz Lennert<br>>> <<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a> <mailto:<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.<wbr>worldonline.be</a>>> wrote:<br>>>><br>>>><br>>>> On 07/04/17 14:05, Markus Metz wrote:<br>>><br>>> [...]<br>>>>><br>>>>><br>>>>> If you compile GRASS from source, you can svn checkout the r.pi folder,<br>>>>> manually run make and (as root) make install.<br>>>><br>>>><br>>>><br>>>> Trying this, I get two errors while compiling:<br>>>><br>>>> make[1] : on entre dans le répertoire «<br>>><br>>> /data/home/mlennert/SRC/GRASS/<wbr>grass-addons/grass7/raster/r.<wbr>pi/r.pi.grow »<br>>>><br>>>><br>>>> and<br>>>><br>>>> make[1] : on entre dans le répertoire «<br>>><br>>> /data/home/mlennert/SRC/GRASS/<wbr>grass-addons/grass7/raster/r.<wbr>pi/r.pi.lm »<br>>><br>>> Fixed in r70952. Please test (not only compilation, but also actual<br>>> results).<br>><br>><br>> Here are some rapid tests based on the man pages examples (with me not understanding most of the metrics, yet):<br>><br>> ******************************<wbr>***************<br>> r.pi.index<br>><br>> I get identical area and perimeter values as from r.object.geometry.<br>><br>> Compactness and fractal dimension are not identical to the respective either measures of r.object.geometry (for compactness for neither of the two in r.object.geometry), but I haven't read through the Fragstat manual nor though the code to see how they are calculated here.<br><br></div>In r.pi.index, compactness is apparently calculated as the area of the bounding box divided by the actual area of a patch, and fractal dimension of a patch is calculated as 2 * log(0.25 * perimeter) / log(area). These formulas are different from r.object.geometry. Also, r.pi.index uses cells as unit, not map units or meters.<br><div>><br>> If r.pi.index allowed an output of all indicators directly to text file this could possibly supersede r.object.geometry. No need to maintain two similar modules, or ?<br><br></div><div>Be aware that the r.pi modules are *not* maintained, while r.object.geometry is being maintained. I would rather remove r.pi modules if their functionality is also covered by other modules.<br></div><div>><br>> ******************************<wbr>***************<br>> r.pi.enn:<br>><br>> r.pi.enn input=landclass96 output=dist1.c5 keyval=5 method=distance number=1 statmethod=average --o<br>><br>> Loading patches...<br>>  100%<br>> Performing operation distance ...<br>>  100%<br>> Writing output...<br>>  100%<br>> ERROR: Raster map <dist1.c5@user1> not found<br>><br>> Probably because of lines 392ff in main.c:<br>><br>><br>>     Rast_write_cats(newname, &cats);<br>><br>>     if (copycolr)<br>>         Rast_write_colors(newname, G_mapset(), &colr);<br>><br>> which try to write to newnames, but maps are actually named with<br>><br>> sprintf(fullname, "%s.NN%d.%s", newname, parseres[j],<br>>                     menu[methods[m]].name);<br>><br>> and so there is no map newname.<br><br></div><div>Copying the colors does not make sense here (coming from the GRASS6 version).<br></div><div><br>> The resulting map does not seem correct, either:<br>><br>> <a href="http://r.info" target="_blank">r.info</a> -r dist1.c5.NN1.distance<br>> min=-nan<br>> max=-nan<br><br></div><div>No idea yet why the results is NULL (-nan is equal to NULL for fp maps).<br></div><div><br>><br>> Same issue with all other examples on that man page. And there is an error in the output name of the third example: output=dist1.5.10,c5 should probably be output=dist1.5.10.c5 (period instead of comma).<br>> ******************************<wbr>***************<br>><br>> ******************************<wbr>**************<br>> r.pi.energy<br>><br>> 1) output=name [required]<br>>     Name for output raster map<br>><br>> This should be described as "Prefix of output raster map names" (or similar). In addition, it would be nice to be able to choose which maps are created.<br><br></div><div>same for e.g. r.pi.enn<br></div><div><br>><br>> 2) The module silently overwrites existing maps which is not a good idea IMHO.<br><br></div><div>Should be fixed, also in other r.pi modules that internally create output raster names from a given prefix.<br></div><div><br>><br>> ******************************<wbr>****************<br>> r.pi.nlm<br>><br>> r.pi.nlm output=nlm.1 landcover=5 --o<br>> r.stats -p nlm.1 --q<br>> 1 0.28%<br>> * 99.72%<br>><br>> r.pi.nlm output=nlm.1 landcover=10 --o<br>> r.stats -p nlm.1 --q<br>> 1 3.22%<br>> * 96.78%<br>><br>> r.pi.nlm output=nlm.1 landcover=25 --o<br>> r.stats -p nlm.1 --q<br>> 1 49.25%<br>> * 50.75%<br>><br>> r.pi.nlm output=nlm.1 landcover=50 --o<br>> r.stats -p nlm.1 --q<br>> 1 50.77%<br>> * 49.23%<br>><br>> r.pi.nlm output=nlm.1 landcover=75 --o<br>> r.stats -p nlm.1 --q<br>> 1 51.97%<br>> * 48.03%<br>><br>> So, I don't really understand the landcover parameter which is indicated as meaning "Landcover in percent".<br><br></div><div>use r.random instead.<br></div><div><br>> ******************************<wbr>****************<br>> r.pi.searchtime<br>><br>><br>> r.pi.searchtime input=landclass96 output=searchtime1 keyval=5 step_length=5 stats=average,variance percent=80 n=1000<br>><br>> There is this output in stdout, which looks like debug info:<br>><br>> average:<br>> frag0: 4.35 frag1: 20.37 frag2: 16.56 frag3: 1.61 frag4: 4.90 frag5: 2.45 frag6: 10.70 frag7: 2.01 frag8: 2.88 frag9: 1.32 frag10: 1.39 frag11: 8.68 frag12: 1.72 frag13: 1.56 frag14: 1.71 frag15: 8.87 frag16: 10.01 frag17: 10.86 frag18: 7.54 frag19: 7.82 frag20: 12.36 frag21: 10.35 frag22: 8.88 frag23: 5.30 frag24: 4.54 frag25: 3.22 frag26: 9.74 frag27: 2.80 frag28: 8.76 frag29: 1.70 frag30: 11.07 frag31: 8.89 frag32: 7.59 frag33: 1.87 frag34: 4.70 frag35: 8.68 frag36: 1.65 frag37: 1.96 frag38: 1.29[...<br><br></div><div>Maybe this is intended, maybe not. Also present in the GRASS6 version.<br></div><div><br>><br>> Again, output=name [required] should be described as "Prefix of output map names" and output overwrites an existing map.<br><br></div><div>As above for other r.pi modules.<br></div><div><br>><br>> That's all I have time for right now. Probably at one point this should all go through the bug tracker ?<br><br></div><div>IMHO, the original authors need to test the r.pi modules first and provide feedback including more documentation on the intended behaviour of the r.pi modules.<br><br></div><div>Markus M<br></div></div>