[GRASS-dev] Re: [GRASS GIS] #783: r.watershed fails on wingrass

GRASS GIS trac at osgeo.org
Sat Oct 10 05:07:47 EDT 2009


#783: r.watershed fails on wingrass
---------------------------+------------------------------------------------
  Reporter:  hamish        |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect        |      Status:  new                      
  Priority:  major         |   Milestone:  6.4.0                    
 Component:  Raster        |     Version:  6.4.0 RCs                
Resolution:                |    Keywords:  r.watershed, wingrass    
  Platform:  MSWindows XP  |         Cpu:  x86-32                   
---------------------------+------------------------------------------------
Comment (by mmetz):

 Replying to [ticket:783 hamish]:
 >
 {{{
 D1/1: Running: "c:/GRASS-6-SVN/etc/r.watershed.ram"
 el="elevation.10m at PERMANENT" t=10000 b
 a="elev10.basin" se="elev10.stream"
 }}}
 >
 Can you try this patch:

 {{{
 --- main.c      (revision 39464)
 +++ main.c      (working copy)
 @@ -233,12 +233,12 @@
      }

      /* Build command line */
 -    sprintf(command, "\"%s/etc/", G_gisbase());
 +    sprintf(command, "\'%s/etc/", G_gisbase());

      if (flag_seg->answer)
 -       strcat(command, "r.watershed.seg\"");
 +       strcat(command, "r.watershed.seg\'");
      else
 -       strcat(command, "r.watershed.ram\"");
 +       strcat(command, "r.watershed.ram\'");
 }}}

 The idea is to replace the double quotes around the path to the executable
 with single quotes in the hope that the windows version of system() is now
 no longer able to strip the leading and trailing quotes of the whole
 command because these are now different.
 >
 > ps- will the .ram and .seg modules fail in GRASS 7 where uppercase
 option names are disallowed? (eg LS= and S=)
 >
 They still work in GRASS 7, probably because they don't call
 G_parser(argc, argv)? Not sure if this is a good idea not to call
 G_parser(argc, argv).
 >
 > pps- should G_convert_dirseps_to_host() be done in the G_gisbase() and
 G_gisdbase() functions instead or making the modules do it?
 >
 In this case, the module should call G_convert_dirseps_to_host() because
 the module adds "/etc/" to G_gisbase().

 Markus M

 PS: Any reason why r39150 didn't make it into trunk?

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


More information about the grass-dev mailing list