[GRASS-dev] Re: [GRASS GIS] #1090: Access is denied - r.statistics

GRASS GIS trac at osgeo.org
Tue Jun 15 17:56:40 EDT 2010


#1090: Access is denied - r.statistics
--------------------------------------------------+-------------------------
 Reporter:  nkale                                 |       Owner:  grass-dev@…              
     Type:  defect                                |      Status:  new                      
 Priority:  normal                                |   Milestone:  6.4.0                    
Component:  Raster                                |     Version:  6.4.0 RCs                
 Keywords:  r.statistics access denied, wingrass  |    Platform:  MSWindows 7              
      Cpu:  x86-32                                |  
--------------------------------------------------+-------------------------
Changes (by hamish):

  * keywords:  r.statistics access denied => r.statistics access denied,
               wingrass


Comment:

 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

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/1090#comment:1>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list