[GRASS-user] wxgui fails using scripts

Dave Roberts dvrbts at ecology.msu.montana.edu
Mon Jun 16 12:59:16 PDT 2014


Dear all,

    I frequently want a thematic map for a variable that is not numeric, 
and thus not permisaable in d.vect.thematic.  In the past a simple 
solution was to write a shell script with d.vect commands.  For example, 
I could create a file called litho.sh with the following lines

d.vect litho type=area where="litho='i'" col=red fcol=red
d.vect litho type=area where="litho='m'" col=orange fcol=orange
d.vect litho type=area where="litho='s'" col=yellow fcol=yellow
d.vect litho type=area where="litho='v'" col=green fcol=green
d.vect litho type=area where="litho='w'" col=blue fcol=blue
d.vect litho type=area where="litho='x'" col=purple fcol=purple

     Then simply "sh litho.sh" would produce the reuslts I wanted, and 
if I decided on a different color scheme it was a trival matter to edit 
the file.

    In wxgui this no longer works, as after the first one or two lines 
GRASS reponds with

d.vect complete.
d.vect complete.
ERROR: No graphics device selected. Use d.mon to select graphics device.
ERROR: No graphics device selected. Use d.mon to select graphics device.
   .     .     .       .      .        .    .   .   .        .       .

etc for each line in the file.  Presumably it's some sort of a buffer 
overflow problem, but it's making my library of scripts useless.  Simply 
pasting the contents of the file into the console with a mouse produces 
the same result.

   Anybody have any good ideas?  I tried inserting a sleep command in 
between each line of the script, and that worked if the sleep interval 
was long enough (2 seconds in my case), but that seems a little silly.

   I realize that I could add a column to the table with a numeric value 
for each value, but I try to avoid arbitrary integer codes that require 
a foreign key to another table to interpret.

Thanks, Dave

Arch linux 3.14.1-1-ARCH, GRASS 70-svn
-- 


More information about the grass-user mailing list