Opened 14 years ago

Closed 14 years ago

#1090 closed defect (fixed)

Access is denied - r.statistics

Reported by: nkale Owned by: grass-dev@…
Priority: normal Milestone: 6.4.0
Component: Raster Version: 6.4.0 RCs
Keywords: r.statistics access denied, wingrass Cc:
CPU: x86-32 Platform: MSWindows 7

Description

Related to ticket #1038 - Running the following:

r.statistics --verbose base=HUC@PERMANENT cover=ag@PERMANENT method=sum output=huc_ag

results in the following error:

Access is denied. ERROR: o_sum: running r.stats command

Same results when attempting to run an average as well. The fix mentioned in the other ticket (change security settings to full control for USER) didn't work.

Change History (9)

comment:1 by hamish, 14 years ago

Keywords: wingrass added

does r.stats run on its own? how about g.tempfile pid=1234?

note o_sum.c in gr65 calls r.stats via system() with:

#define STATS "r.stats"
#define RECLASS "r.reclass"
...
    sprintf(command, "%s -cn input=\"%s,%s\" fs=space > %s", STATS, basemap,
            covermap, tempfile1);

    if (stat = system(command)) {
        unlink(tempfile1);
        G_fatal_error(_("%s: running %s command"), me, STATS);
    }

but before dealing with system(), a starting point might be:

Index: o_sum.c
===================================================================
--- o_sum.c     (revision 42566)
+++ o_sum.c     (working copy)
@@ -27,7 +27,7 @@
     tempfile1 = G_tempfile();
     tempfile2 = G_tempfile();
 
-    sprintf(command, "%s -cn input=\"%s,%s\" fs=space > \"%s\"", STATS, basemap,
+    sprintf(command, "%s -cn input=\"%s,%s\" fs=space output=\"%s\"", STATS, basemap,
            covermap, tempfile1);
 
     if (stat = system(command)) {

Hamish

comment:2 by nkale, 14 years ago

Didn't really follow anything below "note 0_sum.c in gr65...", but as for the commands you suggested:

r.stats ag@PERMANENT - runs fine, no errors, meaningful output r.stats HUC@PERMANENT - runs fine, no errors, meaningful output g.tempfile pid=1234 - no errors, output is:

C:/Users/Nat Kale/Documents/Grass_GIS DataBase/Alberts_Landcover/PERMANENT/.tmp/1234.1

That is the correct location & mapset. Can't think of anything else to try.

comment:3 by hamish, 14 years ago

could you give the grass 7 daily snapshot a try? it uses an improved method to generate the stats and hopefully bypasses the problem.

system() replaced with G_system() in grass 6.5svn with r42570, daily WinGrass snapshots for 6.5 are probably broken until bug #1089 gets fixed, and it this wants testing there before backporting to 6.4.

cheers, Hamish

in reply to:  3 ; comment:4 by nkale, 14 years ago

Replying to hamish:

could you give the grass 7 daily snapshot a try? it uses an improved method to generate the stats and hopefully bypasses the problem.

system() replaced with G_system() in grass 6.5svn with r42570, daily WinGrass snapshots for 6.5 are probably broken until bug #1089 gets fixed, and it this wants testing there before backporting to 6.4.

cheers, Hamish

That worked. Ran with a slightly smaller dataset (didn't know if the raster format was the same between 6 & 7, so I had to do some lengthy re-importing), but I didn't get any errors, and the output map made sense.

On the other hand, in 7 I can no longer launch GRASS in MSYS mode, but that's maybe a bug for another ticket.

Thanks,

Nat

in reply to:  4 ; comment:5 by hamish, 14 years ago

Replying to hamish:

could you give the grass 7 daily snapshot a try?

... Replying to nkale:

That worked.

ok, good. in a few days once grass6.5 daily snapshots are fixed I might ask you to try that.

Ran with a slightly smaller dataset (didn't know if the raster format was the same between 6 & 7, so I had to do some lengthy re-importing),

for now it is the same, but that is likely to change in the future.

but I didn't get any errors, and the output map made sense.

On the other hand, in 7 I can no longer launch GRASS in MSYS mode, but that's maybe a bug for another ticket.

Known problem, being worked on.

Hamish

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

Replying to hamish:

Replying to hamish:

could you give the grass 7 daily snapshot a try?

... Replying to nkale:

That worked.

ok, good. in a few days once grass6.5 daily snapshots are fixed I might ask you to try that.

I've tried following grass65-nightly build: WinGRASS-6.5.SVN-r42351-1-Setup.exe

(Sat Jun 19 13:28:32 2010)                                                      
r.statistics base=elevation_int@user1 cover=geology_30m@PERMANENT method=sum output=elev_int_geol
(Sat Jun 19 13:28:33 2010) Befehl ausgeführt (1 sec)   

r.statistics seems to work, no error message.

Helmut

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

Replying to hellik:

Replying to hamish:

Replying to hamish:

could you give the grass 7 daily snapshot a try?

... Replying to nkale:

That worked.

ok, good. in a few days once grass6.5 daily snapshots are fixed I might ask you to try that.

I've tried following grass65-nightly build: WinGRASS-6.5.SVN-r42351-1-Setup.exe

the nightly build is from 2010/06/19, maybe revision-number is not correct? tested on WinVista32

Helmut

in reply to:  7 comment:8 by martinl, 14 years ago

Replying to hellik:

I've tried following grass65-nightly build: WinGRASS-6.5.SVN-r42351-1-Setup.exe

the nightly build is from 2010/06/19, maybe revision-number is not correct? tested on WinVista32

right, grass65 is broken for several days. Fixed, going to recompile all branches. Martin

comment:9 by hamish, 14 years ago

Resolution: fixed
Status: newclosed

tested in 6.4 on wingrass, still fixed.

Note: See TracTickets for help on using tickets.