[GRASS-dev] r.pi installation fails

Moritz Lennert mlennert at club.worldonline.be
Wed Apr 26 03:03:41 PDT 2017


On 25/04/17 22:14, Markus Metz wrote:
>
> On Tue, Apr 25, 2017 at 3:31 PM, Moritz Lennert
> <mlennert at club.worldonline.be <mailto:mlennert at club.worldonline.be>> wrote:
>>
>> On 07/04/17 14:05, Markus Metz wrote:
> [...]
>>>
>>> If you compile GRASS from source, you can svn checkout the r.pi folder,
>>> manually run make and (as root) make install.
>>
>>
>> Trying this, I get two errors while compiling:
>>
>> make[1] : on entre dans le répertoire «
> /data/home/mlennert/SRC/GRASS/grass-addons/grass7/raster/r.pi/r.pi.grow »
>>
>> and
>>
>> make[1] : on entre dans le répertoire «
> /data/home/mlennert/SRC/GRASS/grass-addons/grass7/raster/r.pi/r.pi.lm »
>
> Fixed in r70952. Please test (not only compilation, but also actual
> results).

Here are some rapid tests based on the man pages examples (with me not 
understanding most of the metrics, yet):

*********************************************
r.pi.index

I get identical area and perimeter values as from r.object.geometry.

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.

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 ?

*********************************************
r.pi.enn:

r.pi.enn input=landclass96 output=dist1.c5 keyval=5 method=distance 
number=1 statmethod=average --o

Loading patches...
  100%
Performing operation distance ...
  100%
Writing output...
  100%
ERROR: Raster map <dist1.c5 at user1> not found

Probably because of lines 392ff in main.c:


     Rast_write_cats(newname, &cats);

     if (copycolr)
         Rast_write_colors(newname, G_mapset(), &colr);

which try to write to newnames, but maps are actually named with

sprintf(fullname, "%s.NN%d.%s", newname, parseres[j],
                     menu[methods[m]].name);

and so there is no map newname. The resulting map does not seem correct, 
either:

r.info -r dist1.c5.NN1.distance
min=-nan
max=-nan


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).
*********************************************

********************************************
r.pi.energy

r.pi.energy input=landclass96 output=energy1 keyval=5 n=1000 
step_length=5 energy=10 percent=80

It runs and there are results. At this stage I don't understand the 
module enough to judge the quality of the results, but:

1) output=name [required]
     Name for output raster map

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.

2) The module silently overwrites existing maps which is not a good idea 
IMHO.
**********************************************


**********************************************
r.pi.nlm

r.pi.nlm output=nlm.1 landcover=5 --o
r.stats -p nlm.1 --q
1 0.28%
* 99.72%

r.pi.nlm output=nlm.1 landcover=10 --o
r.stats -p nlm.1 --q
1 3.22%
* 96.78%

r.pi.nlm output=nlm.1 landcover=25 --o
r.stats -p nlm.1 --q
1 49.25%
* 50.75%

r.pi.nlm output=nlm.1 landcover=50 --o
r.stats -p nlm.1 --q
1 50.77%
* 49.23%

r.pi.nlm output=nlm.1 landcover=75 --o
r.stats -p nlm.1 --q
1 51.97%
* 48.03%

So, I don't really understand the landcover parameter which is indicated 
as meaning "Landcover in percent".
***********************************************

**********************************************
r.pi.searchtime


r.pi.searchtime input=landclass96 output=searchtime1 keyval=5 
step_length=5 stats=average,variance percent=80 n=1000

There is this output in stdout, which looks like debug info:

average:
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[...

Again, output=name [required] should be described as "Prefix of output 
map names" and output overwrites an existing map.

I can't judge the quality of the results.
******************************************************

That's all I have time for right now. Probably at one point this should 
all go through the bug tracker ?

Moritz


More information about the grass-dev mailing list