[GRASS-user] wxgui fails using scripts

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.
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
--

Dave,

On Mon, Jun 16, 2014 at 9:59 PM, Dave Roberts
...

    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

Did you try the standalone monitor?

d.mon wx0
(also wx1, wx2 etc)

It still suffers from being very slow but should "listen" to the command line.

Markus

Hi Markus,

    Sorry, I misspoke. I did mean wx0. I work from the command line, not the full GUI. I think of wx0 as also a GUI due to the toolbar at the top.

    Even the simple script below occasionally fails on the d.vect command

d.erase
g.region study
d.his h=elev i=hillshd
d.vect boundary type=boundary col=white

Dave

On 06/17/2014 11:26 AM, Markus Neteler wrote:

Dave,

On Mon, Jun 16, 2014 at 9:59 PM, Dave Roberts
...

     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

Did you try the standalone monitor?

d.mon wx0
(also wx1, wx2 etc)

It still suffers from being very slow but should "listen" to the command line.

Markus

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
David W. Roberts office 406-994-4548
Professor and Head FAX 406-994-3190
Department of Ecology email droberts@montana.edu
Montana State University
Bozeman, MT 59717-3460

On Wed, Jun 18, 2014 at 3:09 PM, Dave Roberts
<dvrbts@ecology.msu.montana.edu> wrote:

   Sorry, I misspoke. I did mean wx0. I work from the command line, not the full GUI. I think of wx0 as also a GUI due to the toolbar at the top.

   Even the simple script below occasionally fails on the d.vect command

(which error?)

d.erase
g.region study
d.his h=elev i=hillshd

--> after d.his wait some seconds

d.vect boundary type=boundary col=white

then it may work. As mentioned, the d.mon is currently lacking a kind
of queueing mechanism.

Markus