[GRASS-dev] Re: [GRASS GIS] #1574: WXGUI Launch script: "output already exists" (was: v.to.rast in python loop: Error raster already exists)

GRASS GIS trac at osgeo.org
Fri Feb 17 03:55:58 EST 2012


#1574: WXGUI Launch script: "output already exists"
---------------------------+------------------------------------------------
 Reporter:  jradinger      |       Owner:  grass-dev@…              
     Type:  defect         |      Status:  new                      
 Priority:  normal         |   Milestone:  6.5.0                    
Component:  wxGUI          |     Version:  svn-develbranch6         
 Keywords:  wxgui, script  |    Platform:  All                      
      Cpu:  All            |  
---------------------------+------------------------------------------------
Changes (by mlennert):

  * keywords:  => wxgui, script
  * platform:  MacOSX => All
  * cpu:  OSX/Intel => All


Comment:

 Replying to [ticket:1574 jradinger]:
 > When I try to launch a python script via File -> lauch Script
 > that calls v.to.rast in loop, I get the error that the raster file
 already exists.

 After a bit of testing I can confirm the error, but it seems that this is
 neither linked to a for loop, nor to the fact that this is a python
 script. I tried both python and bash scripts with simple operations such
 as v.to.rast, r.to.vect and v.select and they all failed with the message
 that the output exists, although I always run


 {{{
 g.mremove rast="*" vect="*" -f
 }}}

 before running the script.

 I've tried with very simple scripts not invoking the parser (i.e. just
 one-line bash scripts) and get the same message.

 So, it seems that the GUI tries to run the GRASS commands within the
 script twice. The first time it works as foreseen, the second time it
 logically bails out with the message that the output already exists. The
 rest of the script is only run once (at least any print or echo statements
 only show up once).

 On the command line all these script work perfectly. Calling the script
 directly from the GUI command prompt also leads to the same error message.

 This happens to every GRASS command in the script, i.e.:


 {{{
 #! /bin/bash

 echo "running script"
 r.to.vect input=myroads output=myroads
 v.select ainput=roadsmajor binput=censusblk_swwake output=selected_roads
 operator=within
 }}}

 gives me two error messages about myroads and selected_roads already
 existing, but both commands ran fine and I have the expected results.

 Moritz

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



More information about the grass-dev mailing list