Opened 10 years ago

Closed 8 years ago

#2392 closed defect (fixed)

winGRASS GIS 6.4.5 svn r.li modules - issues with hard coded path to conf files

Reported by: hellik Owned by: grass-dev@…
Priority: critical Milestone: 6.4.6
Component: Raster Version: svn-releasebranch64
Keywords: wingrass, r.li Cc:
CPU: x86-32 Platform: MSWindows 7

Description

from the ML

http://lists.osgeo.org/pipermail/grass-dev/2014-August/070384.html

now conf-file generated in winGRASS7.1svn and the conf file stored e.g. 

C:\Users\normal\AppData\Roaming\GRASS6\movwindow7

some test:

r.li.mps --verbose map=myforest at user1
conf=C:\Users\normal\AppData\Roaming\GRASS6\movwindow7
output=myforest_mean_patch_size
ERROR: Cannot find configuration file
<C:\Users\normal\.r.li\history\C:\Users\normal\AppData\Roaming\GRASS6\movwindow7>

r.li.padrange --verbose map=myforest at user1
conf=C:\Users\normal\AppData\Roaming\GRASS6\movwindow7
output=myforest_padrange
ERROR: Cannot find configuration file
<C:\Users\normal\.r.li\history\C:\Users\normal\AppData\Roaming\GRASS6\movwindow7>

r.li.padsd --verbose map=myforest at user1
conf=C:\Users\normal\AppData\Roaming\GRASS6\movwindow7 output=myforest_padsd
ERROR: Cannot find configuration file
<C:\Users\normal\.r.li\history\C:\Users\normal\AppData\Roaming\GRASS6\movwindow7>

although the path to the conf file is given, it seems it's hard coded where
the r.li.*-module looks for the conf file (see doubling the path in the
error message)

manually creating the .r.li-folder where the module looks for and manually
putting there the conf file, the r.li.*-module is working:

r.li.padsd --verbose map=myforest at user1
conf=C:\Users\normal\.r.li\history\movwindow7 output=myforest_padsd
r.li.padsd komplett. Raster map <myforest_padsd> created.

Change History (13)

comment:1 by hellik, 10 years ago

Summary: GRASS GIS 6.4.5 svn r.li modules - issues with hard coded path to conf fileswinGRASS GIS 6.4.5 svn r.li modules - issues with hard coded path to conf files

comment:2 by hellik, 10 years ago

Keywords: wingrass r.li added

in reply to:  description ; comment:3 by neteler, 10 years ago

Replying to hellik: ...

although the path to the conf file is given

To my knowledge the path should actually *not* be given (see manual page).

Does this help?

in reply to:  3 comment:4 by hellik, 10 years ago

Replying to neteler:

Replying to hellik: ...

although the path to the conf file is given

To my knowledge the path should actually *not* be given (see manual page).

I can't find this in the man page; any hint where it's noted not giving the path?

further there are differences between winGRASS6 and winGRASS7 where the con file is stored by the setup

in reply to:  description ; comment:5 by neteler, 10 years ago

Replying to hellik:

from the ML

http://lists.osgeo.org/pipermail/grass-dev/2014-August/070384.html

now conf-file generated in winGRASS7.1svn and the conf file stored e.g. 

C:\Users\normal\AppData\Roaming\GRASS6\movwindow7

Note that the r.li directory is different in GRASS GIS 6 from than what you tried:

# Linux
$HOME/.r.li/history/movwindow7

# Windows (untested, please test)
C:\Users\normal\AppData\Roaming\GRASS6\.r.li\history\movwindow7

... and no path in conf= when running the r.li.* modules.

See also: http://grasswiki.osgeo.org/wiki/GRASS_configuration_files_in_home_directory

You may try to use 'g.gisenv set="DEBUG=1"' to check where r.li.* is seeking.

Once understood, we should add a note in grass64/raster/r.li/r.li.setup/description.html

in reply to:  5 ; comment:6 by hellik, 10 years ago

Replying to neteler:

Replying to hellik:

from the ML

http://lists.osgeo.org/pipermail/grass-dev/2014-August/070384.html

now conf-file generated in winGRASS7.1svn and the conf file stored e.g. 

C:\Users\normal\AppData\Roaming\GRASS6\movwindow7

Note that the r.li directory is different in GRASS GIS 6 from than what you tried:

as setup is not working at the moment in winGRASS6, I've created the conf file in winGRASS7; and there are different places in winGRASS6 and winGRASS7 where the conf file is stored by r.li.setup

# Linux
$HOME/.r.li/history/movwindow7

# Windows (untested, please test)
C:\Users\normal\AppData\Roaming\GRASS6\.r.li\history\movwindow7

in winGRASS6, it's

C:\Users\normal\.r.li

in winGRASS7, it's

C:\Users\normal\AppData\Roaming\GRASS7

... and no path in conf= when running the r.li.* modules.

See also: http://grasswiki.osgeo.org/wiki/GRASS_configuration_files_in_home_directory

You may try to use 'g.gisenv set="DEBUG=1"' to check where r.li.* is seeking.

as noted before, it's seeked in

C:\Users\normal\.r.li

Once understood, we should add a note in grass64/raster/r.li/r.li.setup/description.html

yes

in reply to:  6 comment:7 by hellik, 10 years ago

Replying to hellik:

in winGRASS7, it's

C:\Users\normal\AppData\Roaming\GRASS7

it's

C:\Users\normal\AppData\Roaming\GRASS7\r.li

comment:8 by neteler, 10 years ago

Improved docs in G7: r61665 (r61666) and G6: r61667 (r61668). Please check.

in reply to:  description comment:9 by neteler, 10 years ago

It appears that the issue only comes up when using the GUI. So:

Replying to hellik: ...

C:\Users\normal\AppData\Roaming\GRASS6\movwindow7

some test:

r.li.mps --verbose map=myforest at user1 conf=C:\Users\normal\AppData\Roaming\GRASS6\movwindow7 output=myforest_mean_patch_size ERROR: Cannot find configuration file <C:\Users\normal\.r.li\history\C:\Users\normal\AppData\Roaming\GRASS6\movwindow7>

I think that the issue in GRASS 6 is that we use the macro G_define_standard_option(G_OPT_F_INPUT) which contains this button generating line Opt->gisprompt = "old_file,file,input";

For GRASS 6, we may need to replace the macro with the full definition in each r.li module and omit the gisprompt line to not have the GUI button. Obviously it becomes more difficult to find the names of the conf file.

Ideally the conf file button would open the ....\.r.li\history\ directory but that's AFAIK not possible. Other ideas?

comment:10 by martinl, 9 years ago

Milestone: 6.4.5

Ticket retargeted after milestone closed

comment:11 by martinl, 9 years ago

Milestone: 6.4.6

comment:12 by neteler, 8 years ago

A lot of love has been given to r.li in GRASS GIS 7. Maybe we can close this ticket as "fixed in new stable release"?

in reply to:  12 comment:13 by hellik, 8 years ago

Resolution: fixed
Status: newclosed

Replying to neteler:

A lot of love has been given to r.li in GRASS GIS 7. Maybe we can close this ticket as "fixed in new stable release"?

yes; closing ticket.

Note: See TracTickets for help on using tickets.