Discussion:
[GRASSGUI] wxgrass won't work - how to set up digitization?
Michael Barton
2007-11-14 22:56:53 UTC
Permalink
Martin,

I just updated all and now wxgrass won't start. I get the following error...

GRASS 6.3.cvs (spearfish60_test):~ > Traceback (most recent call last):
File
"/Applications/Grass/GRASS-6.3.app/Contents/Resources/etc/wx/wxgui.py", line
57, in <module>
import gui_modules.wxgui_utils as wxgui_utils
File
"/Applications/Grass/GRASS-6.3.app/Contents/Resources/etc/wx/gui_modules/wxg
ui_utils.py", line 36, in <module>
import mapdisp
File
"/Applications/Grass/GRASS-6.3.app/Contents/Resources/etc/wx/gui_modules/map
disp.py", line 55, in <module>
import toolbars
File
"/Applications/Grass/GRASS-6.3.app/Contents/Resources/etc/wx/gui_modules/too
lbars.py", line 28, in <module>
from digit import Digit as Digit
File
"/Applications/Grass/GRASS-6.3.app/Contents/Resources/etc/wx/gui_modules/dig
it.py", line 60, in <module>
from grass6_wxdriver import DisplayDriver
ImportError: No module named grass6_wxdriver

I assume that I need the new displaydriver C module you have written. I
copied it into my running version and tried to make it, but got the
following error...

Last login: Sat Aug 18 11:48:21 on ttyp1
Welcome to Darwin!
cmb-MBP:~ cmbarton$ cd
/Applications/Grass/GRASS-6.3.app/Contents/Resources/etc/wx/display_driver/
cmb-MBP:/Applications/Grass/GRASS-6.3.app/Contents/Resources/etc/wx/display_
driver cmbarton$ make
Makefile:17: warning: overriding commands for target `clean'
../../../include/Make/Rules.make:34: warning: ignoring old commands for
target `clean'
cat ./driver.i > grass6_wxdriver.i
echo "/* auto-generate swig typedef file (with some GRASS functions removed)
*/" >> grass6_wxdriver.i
cat ./driver.h >> grass6_wxdriver.i
swig -c++ -python -shadow grass6_wxdriver.i
make: swig: Command not found
make: *** [grass6_wxdriver_wrap.cxx] Error 127

What do I need to do to make this work?

BTW, my GRASS is compiled with PYTHON support, so swig *ought* to be there.
I probably am just doing this wrong.

Thanks
Michael

__________________________________________
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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-gui/attachments/20070818/dd6c5d4d/attachment.html
Martin Landa
2007-11-14 22:56:53 UTC
Permalink
Hi Michael,

now fixed in SVN. The C++ driver is not finished yet.

Martin
Post by Michael Barton
Martin,
I just updated all and now wxgrass won't start. I get the following error...
File
"/Applications/Grass/GRASS-6.3.app/Contents/Resources/etc/wx/wxgui.py",
line 57, in <module>
import gui_modules.wxgui_utils as wxgui_utils
File
"/Applications/Grass/GRASS-6.3.app/Contents/Resources/etc/wx/gui_modules/wxgui_utils.py",
line 36, in <module>
import mapdisp
File
"/Applications/Grass/GRASS-6.3.app/Contents/Resources/etc/wx/gui_modules/mapdisp.py",
line 55, in <module>
import toolbars
File
"/Applications/Grass/GRASS-6.3.app/Contents/Resources/etc/wx/gui_modules/toolbars.py",
line 28, in <module>
from digit import Digit as Digit
File
"/Applications/Grass/GRASS-6.3.app/Contents/Resources/etc/wx/gui_modules/digit.py",
line 60, in <module>
from grass6_wxdriver import DisplayDriver
ImportError: No module named grass6_wxdriver
I assume that I need the new displaydriver C module you have written. I
copied it into my running version and tried to make it, but got the
following error...
Last login: Sat Aug 18 11:48:21 on ttyp1
Welcome to Darwin!
cmb-MBP:~ cmbarton$ cd
/Applications/Grass/GRASS-6.3.app/Contents/Resources/etc/wx/display_driver/
cmb-MBP:/Applications/Grass/GRASS-6.3.app/Contents/Resources/etc/wx/display_driver
cmbarton$ make
Makefile:17: warning: overriding commands for target `clean'
../../../include/Make/Rules.make:34: warning: ignoring old
commands for target `clean'
cat ./driver.i > grass6_wxdriver.i
echo "/* auto-generate swig typedef file (with some GRASS functions
removed) */" >> grass6_wxdriver.i
cat ./driver.h >> grass6_wxdriver.i
swig -c++ -python -shadow grass6_wxdriver.i
make: swig: Command not found
make: *** [grass6_wxdriver_wrap.cxx] Error 127
What do I need to do to make this work?
BTW, my GRASS is compiled with PYTHON support, so swig *ought* to be there.
I probably am just doing this wrong.
Thanks
Michael
__________________________________________
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
--
Martin Landa <***@gmail.com> * http://gama.fsv.cvut.cz/~landa *
Moritz Lennert
2007-11-14 22:56:53 UTC
Permalink
Post by Martin Landa
Hi Michael,
now fixed in SVN. The C++ driver is not finished yet.
Does this mean we will have mission-critical elements (such as
digitiation) in C++ ? In view of all the problems this has caused in the
past, I would strongly plead against this.

Moritz
Glynn Clements
2007-11-14 22:56:53 UTC
Permalink
Post by Moritz Lennert
Post by Martin Landa
now fixed in SVN. The C++ driver is not finished yet.
Does this mean we will have mission-critical elements (such as
digitiation) in C++ ? In view of all the problems this has caused in the
past, I would strongly plead against this.
For reasons which I've gone over more times that I care to remember, I
strongly suggest that anything which links against GRASS libraries
should be a separate program.
--
Glynn Clements <***@gclements.plus.com>
Martin Landa
2007-11-14 22:56:53 UTC
Permalink
Hi,
Post by Moritz Lennert
Does this mean we will have mission-critical elements (such as
digitiation) in C++ ?
in C++ is written only minimalistic display driver (library) for
digitization tool which draws vector elements on map canvas. This
library is used only for rendering purposes (question of speed). C++
because wxWidgets is written in C++! It shouldn't case any problems.
Post by Moritz Lennert
In view of all the problems this has caused in the
past, I would strongly plead against this.
I am not sure what you refer to (r.terraflow pain is more connected
with the way how this module is written AFAIK).

Martin
Post by Moritz Lennert
Moritz
_______________________________________________
grass-dev mailing list
http://grass.itc.it/mailman/listinfo/grass-dev
--
Martin Landa <***@gmail.com> * http://gama.fsv.cvut.cz/~landa *
Glynn Clements
2007-11-14 22:56:53 UTC
Permalink
Post by Martin Landa
Post by Moritz Lennert
Does this mean we will have mission-critical elements (such as
digitiation) in C++ ?
in C++ is written only minimalistic display driver (library) for
digitization tool which draws vector elements on map canvas. This
library is used only for rendering purposes (question of speed).
Do you mean the actual rendering, or retrieving the vector data to be
rendered?
Post by Martin Landa
C++
because wxWidgets is written in C++! It shouldn't case any problems.
Post by Moritz Lennert
In view of all the problems this has caused in the
past, I would strongly plead against this.
I am not sure what you refer to (r.terraflow pain is more connected
with the way how this module is written AFAIK).
Some of r.terraflow's problems are due to extensive use of C++
features (e.g. templates, STL). But even with minimal use of C++, you
still tend to end up with relatively fragile binaries (i.e. they won't
work on a system that's even slightly different to the one on which
they were compiled).

But my main concern is about calling GRASS library functions directly
from the GUI, whether via C or C++. As I've mentioned before, the
GRASS API is unsuitable for such use.
--
Glynn Clements <***@gclements.plus.com>
Martin Landa
2007-11-14 22:56:53 UTC
Permalink
Hi,
Post by Glynn Clements
Post by Martin Landa
Post by Moritz Lennert
Does this mean we will have mission-critical elements (such as
digitiation) in C++ ?
in C++ is written only minimalistic display driver (library) for
digitization tool which draws vector elements on map canvas. This
library is used only for rendering purposes (question of speed).
Do you mean the actual rendering, or retrieving the vector data to be
rendered?
Sorry, I mean retrieving the vector data to be rendered...

Regards, Martin
--
Martin Landa <***@gmail.com> * http://gama.fsv.cvut.cz/~landa *
Glynn Clements
2007-11-14 22:56:53 UTC
Permalink
Post by Martin Landa
Post by Glynn Clements
Post by Martin Landa
Post by Moritz Lennert
Does this mean we will have mission-critical elements (such as
digitiation) in C++ ?
in C++ is written only minimalistic display driver (library) for
digitization tool which draws vector elements on map canvas. This
library is used only for rendering purposes (question of speed).
Do you mean the actual rendering, or retrieving the vector data to be
rendered?
Sorry, I mean retrieving the vector data to be rendered...
That probably does need to be done in C.

You could use a slave process to do that part, but it would need to be
persistent; you can't spawn a new command for each operation.

If the Python code is loading a binary module which uses the GRASS
libraries, the digitiser needs to be a separate process from the rest
of wxgrass.
--
Glynn Clements <***@gclements.plus.com>
Loading...