[GRASS-dev] [GRASS GIS] #117: r.digit fails if launched from menu

#117: r.digit fails if launched from menu
------------------------+---------------------------------------------------
Reporter: 4everskiff | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: major | Milestone: 6.3.0
Component: default | Version: 6.3.0 RCs
Keywords: |
------------------------+---------------------------------------------------
Tested on WinGRASS-6.3.0RC6

There's an error in the following menu command:

Raster -> Develop map -> Digitize raster

while r.digit works fine if launched from command line (both pure command
line and Run GUI command option)

error log reported in attached file

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/117&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#117: r.digit fails if launched from menu
-------------------------+--------------------------------------------------
  Reporter: 4everskiff | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.3.0
Component: default | Version: 6.3.0 RCs
Resolution: | Keywords:
-------------------------+--------------------------------------------------
Comment (by marisn):

There are some small bugfixes pending in Michael's patch list. After
commiting, they have to be backported to 6.3.0. Still with trunk there's
an issue, that guarantee_xmon doesn't work anymore.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/117#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#117: r.digit fails if launched from menu
-------------------------+--------------------------------------------------
  Reporter: 4everskiff | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.3.0
Component: default | Version: 6.3.0 RCs
Resolution: | Keywords:
-------------------------+--------------------------------------------------
Comment (by hamish):

is xterm installed?

Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/117#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#117: r.digit fails if launched from menu
-------------------------+--------------------------------------------------
  Reporter: 4everskiff | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.3.0
Component: default | Version: 6.3.0 RCs
Resolution: | Keywords:
-------------------------+--------------------------------------------------
Comment (by hamish):

If you have no xterm, you might try putting something like this in
~/.grass.bashrc
(if you have rxvt...)

export GRASS_XTERM=rxvt

Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/117#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#117: r.digit fails if launched from menu
-------------------------+--------------------------------------------------
  Reporter: 4everskiff | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.3.0
Component: default | Version: 6.3.0 RCs
Resolution: | Keywords:
-------------------------+--------------------------------------------------
Comment (by hamish):

I changed grass-xterm-wrapper to automatically look for rxvt if xterm is
not there (r30863)*, but I have zero idea at all how grass-xterm-wrapper
should be handled for native MS Windows installs (but guarantee-xmon is
useless there anyway, as there is no xmons, so don't bother?).

[*] add others as needed (eterm?). I added only rxvt because that's all I
use; xterm is no longer installed by default on Debian.

note r.digit is just a simple front end to r.in.poly, which uses an ascii
format very similar to v.in.ascii's format=standard. Thus creating a new
wxPython raster digitizer to replace the old r.digit should not be /that/
much work.
IMO using r.in.poly is a slightly better approach than v.digit+v.to.rast,
although the latter happening for the backend wouldn't be so bad if it
could be automated.

Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/117#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#117: r.digit fails if launched from menu
-------------------------+--------------------------------------------------
  Reporter: 4everskiff | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.3.0
Component: default | Version: 6.3.0 RCs
Resolution: | Keywords:
-------------------------+--------------------------------------------------
Comment (by hamish):

> Tested on WinGRASS-6.3.0RC6
...
> while r.digit works fine if launched from command line (both pure
command line
> and Run GUI command option)

r.digit works fine if launched from the WinGRASS command line?! This isn't
Cygwin, right?

H

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/117#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

GRASS GIS wrote:

#117: r.digit fails if launched from menu
-------------------------+--------------------------------------------------
  Reporter: 4everskiff | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.3.0
Component: default | Version: 6.3.0 RCs
Resolution: | Keywords:
-------------------------+--------------------------------------------------
Comment (by hamish):

I changed grass-xterm-wrapper to automatically look for rxvt if xterm is
not there (r30863)*, but I have zero idea at all how grass-xterm-wrapper
should be handled for native MS Windows installs

You can use "start" to run a command in a new console window.

You need to consume all of the switches up to and including -e, e.g.:

  #!/bin/sh
  # xterm "emulator" for Windows
  while [ "$1" != "-e" ] ; do shift ; done
  shift
  exec start "$@"

(but guarantee-xmon is
useless there anyway, as there is no xmons, so don't bother?).

There are presumably other cases which use grass-xterm-wrapper, but
it wouldn't surprise me if every one of them did something which
wouldn't work on Windows.

--
Glynn Clements <glynn@gclements.plus.com>

#117: r.digit fails if launched from menu
-------------------------+--------------------------------------------------
  Reporter: 4everskiff | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.3.0
Component: default | Version: 6.3.0 RCs
Resolution: | Keywords:
-------------------------+--------------------------------------------------
Comment (by 4everskiff):

Replying to [comment:5 hamish]:

> r.digit works fine if launched from the WinGRASS command line?! This
isn't Cygwin, right?

Yes, this is WinGRASS (Native Windows Binary) and r.digit works fine if
started from command line (output window, both Run and RunGUI options).
Current WinGRASS release contains rxvt as standard.

Marco Pasetti

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/117#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#117: r.digit fails if launched from menu
-------------------------+--------------------------------------------------
  Reporter: 4everskiff | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.3.0
Component: default | Version: 6.3.0 RCs
Resolution: | Keywords:
-------------------------+--------------------------------------------------
Comment (by hamish):

Hamish:
> > r.digit works fine if launched from the WinGRASS command line?!

Marco:
> Yes, this is WinGRASS (Native Windows Binary) and r.digit works fine if
started
> from command line

You can really digitize then view a map created with it? As far as I knew
r.digit needed an interactive xmon window, which is only available if
using X11. It should fail with a "no monitor found" error *after* you give
it a map name.

Perhaps something changed, but this surprises me.

I have backported grass-xterm-wrapper to the 6.3.0 branch, but I hope
others can add more xterm compatible terms to the list as needed.

see also previous discussion:
   http://thread.gmane.org/gmane.comp.gis.grass.devel/14702
   http://thread.gmane.org/gmane.comp.gis.grass.devel/24109

re r20925, I assume that the various distro's x-terminal-emulator wrappers
have gotten their act together re gnome-terminal since last time we tried.
It works for me on debian (points to /usr/bin/gnome-terminal.wrapper which
translates command line options); could Ubuntu users please re-test to see
if r.digit now works from the gis.m menu? (that's where the earlier
problems were reported)

I don't like changing this so late in the RC cycle, but hopefully it helps
more than it harms.

Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/117#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

GRASS GIS wrote:

#117: r.digit fails if launched from menu
-------------------------+--------------------------------------------------
  Reporter: 4everskiff | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.3.0
Component: default | Version: 6.3.0 RCs
Resolution: | Keywords:
-------------------------+--------------------------------------------------
Comment (by hamish):

Hamish:
> > r.digit works fine if launched from the WinGRASS command line?!

Marco:
> Yes, this is WinGRASS (Native Windows Binary) and r.digit works fine if
started
> from command line

You can really digitize then view a map created with it? As far as I knew
r.digit needed an interactive xmon window, which is only available if
using X11. It should fail with a "no monitor found" error *after* you give
it a map name.

Yep. It uses the R_get_location_with_* functions, so it won't work
without an X monitor.

--
Glynn Clements <glynn@gclements.plus.com>

#117: r.digit fails if launched from menu
-------------------------+--------------------------------------------------
  Reporter: 4everskiff | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.3.0
Component: default | Version: 6.3.0 RCs
Resolution: | Keywords:
-------------------------+--------------------------------------------------
Comment (by 4everskiff):

Replying to [comment:7 hamish]:

> You can really digitize then view a map created with it?

Hi Hamish. Sorry, you're right! I was going to open another ticket, while
I realized that it was related to the same problem of that one. In fact,
for both r.digit and v.digit, the command GUI opens, but the tool panel
don't; that means that it's impossible to actually digitize both rasters
and vectors.

What should we do? leave this ticket opened, or close it and add a new
ticket reporting that r.digit and v.digit don't work?

Marco

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/117#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#117: r.digit fails if launched from menu
-------------------------+--------------------------------------------------
  Reporter: 4everskiff | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.3.0
Component: Tcl | Version: 6.3.0 RCs
Resolution: | Keywords:
-------------------------+--------------------------------------------------
Changes (by martinl):

  * component: default => Tcl

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/117#comment:9&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#117: r.digit: make guarantee_xmon fail nicely on WinGrass
-------------------------+--------------------------------------------------
  Reporter: 4everskiff | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: minor | Milestone: 6.3.0
Component: Tcl | Version: 6.3.0 RCs
Resolution: | Keywords:
-------------------------+--------------------------------------------------
Changes (by hamish):

  * priority: major => minor
  * summary: r.digit fails if launched from menu => r.digit: make
              guarantee_xmon fail nicely on WinGrass

Comment:

AFAIK the Tcl version of v.digit works fine on native WinGrass, it's only
menu items which call guarantee_xmon that won't work. Those are:

{{{
r.digit
r.le.setup
d.path.sh
i.ortho.photo
d.nviz
}}}

I have just modified guarantee_xmon in svn (r30966) to fail in a nicer way
if there are no xmons*. It should really return with an error code, and
menu items that call it should act like "guarantee_xmon && d.module" (I've
no idea how to do that in tcl)

[*] the error message is perhaps misleading if the user has 8 xmons
already running, so no free ones. Feel free to improve it.

nicer would be if those menu items were greyed out for WinGrass. again
I've little clue how to do that in Tcl, but this is the shell code version
that could be run at gui startup time before building the menus:
{{{
if [ `d.mon -L | grep -c '^x[0-9]'` -lt 1 ] ; then
   HAVE_XMON=0
else
   HAVE_XMON=1
fi
}}}

Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/117#comment:10&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#117: r.digit: make guarantee_xmon fail nicely on WinGrass
-------------------------+--------------------------------------------------
  Reporter: 4everskiff | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: minor | Milestone: 6.4.0
Component: Tcl | Version: 6.3.0 RCs
Resolution: | Keywords:
-------------------------+--------------------------------------------------
Changes (by neteler):

  * milestone: 6.3.0 => 6.4.0

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/117#comment:11&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#117: r.digit: make guarantee_xmon fail nicely on WinGrass
-------------------------+--------------------------------------------------
  Reporter: 4everskiff | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: minor | Milestone: 6.4.0
Component: Tcl | Version: 6.3.0 RCs
Resolution: fixed | Keywords:
-------------------------+--------------------------------------------------
Changes (by cmbarton):

  * status: new => closed
* cc: hamish_b@yahoo.com (added)
  * resolution: => fixed

Comment:

I just committed a fix to this, but can't test it on my Mac. At least it
doesn't do any harm on a Mac.

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/117#comment:12&gt;
GRASS GIS <http://grass.osgeo.org>

#117: r.digit: make guarantee_xmon fail nicely on WinGrass
-------------------------+--------------------------------------------------
  Reporter: 4everskiff | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: minor | Milestone: 6.4.0
Component: Tcl | Version: 6.3.0
Resolution: fixed | Keywords:
-------------------------+--------------------------------------------------
Changes (by marcopx):

  * version: 6.3.0 RCs => 6.3.0

Comment:

Replying to [comment:12 cmbarton]:
> I just committed a fix to this, but can't test it on my Mac. At least it
doesn't do any harm on a Mac.
>
> Michael

Hi Michael,

I'll test it as soon as possible. Is it on SVN GRASS trunk?
BTW, the problem is that r.digit doesn't work on windows. Should we really
leave the ticket closed? we probably should open a new ticket, such as:

WinGRASS: r.digit doesn't work

Marco

PS: I created a new OSGEOID, the previous 4everskiff was not actually
appropriate :slight_smile:
Starting from now I will always use the marcopx ID, as in IRC

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/117#comment:13&gt;
GRASS GIS <http://grass.osgeo.org>

#117: r.digit: make guarantee_xmon fail nicely on WinGrass
-------------------------+--------------------------------------------------
  Reporter: 4everskiff | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: minor | Milestone: 6.4.0
Component: Tcl | Version: 6.3.0
Resolution: fixed | Keywords:
-------------------------+--------------------------------------------------
Comment (by martinl):

Replying to [comment:13 marcopx]:
> I'll test it as soon as possible. Is it on SVN GRASS trunk?

it was committed to 'develbranch_6', see

r31350

'trunk' is dedicated for grass7 demolition, for main development (leading
to 6.4.0) is used 'develbranch_6'

I cannot judge if this fix should be also committed to 'trunk'...

Martin

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/117#comment:14&gt;
GRASS GIS <http://grass.osgeo.org>

Marco,

I put this in the development GRASS 6 branch, which is where I think we are
supposed to be working on GUI development at the present--especially for
TclTk--and which will morph into GRASS 6.4.

To be more accurate, it is not that r.digit doesn't work, it is that ANY
command that requires an interactive Xmonitor doesn't work--and won't work
on Windows AFAICT. With TclTk now giving a meaningful message whenever
someone tries to run such a command from the GUI, the TclTk ticket should be
closed.

The other issue, about requiring interactive should indeed be maintained as
an enhancement ticket for GRASS 6.4 and 7. But this will require changes to
the relevent modules' C code. That is, it is not an issue that can be fixed
in the GUI at present.

Michael

On 5/15/08 3:01 AM, "GRASS GIS" <trac@osgeo.org> wrote:

#117: r.digit: make guarantee_xmon fail nicely on WinGrass
-------------------------+--------------------------------------------------
  Reporter: 4everskiff | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: minor | Milestone: 6.4.0
Component: Tcl | Version: 6.3.0
Resolution: fixed | Keywords:
-------------------------+--------------------------------------------------
Changes (by marcopx):

  * version: 6.3.0 RCs => 6.3.0

Comment:

Replying to [comment:12 cmbarton]:

I just committed a fix to this, but can't test it on my Mac. At least it

doesn't do any harm on a Mac.

Michael

Hi Michael,

I'll test it as soon as possible. Is it on SVN GRASS trunk?
BTW, the problem is that r.digit doesn't work on windows. Should we really
leave the ticket closed? we probably should open a new ticket, such as:

WinGRASS: r.digit doesn't work

Marco

PS: I created a new OSGEOID, the previous 4everskiff was not actually
appropriate :slight_smile:
Starting from now I will always use the marcopx ID, as in IRC

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton