wxgrass won't work - how to set up digitization?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

wxgrass won't work - how to set up digitization?

Michael Barton
wxgrass won't work - how to set up digitization? 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/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


_______________________________________________
grassgui mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/grassgui
Reply | Threaded
Open this post in threaded view
|

Re: wxgrass won't work - how to set up digitization?

Martin Landa
Hi Michael,

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

Martin

2007/8/19, Michael Barton <[hidden email]>:

>
>  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/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 <[hidden email]> * http://gama.fsv.cvut.cz/~landa *

_______________________________________________
grassgui mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/grassgui
Reply | Threaded
Open this post in threaded view
|

Re: Re: wxgrass won't work - how to set up digitization?

Moritz Lennert
On 20/08/07 12:45, Martin Landa wrote:
> 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

_______________________________________________
grassgui mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/grassgui
Reply | Threaded
Open this post in threaded view
|

Re: [GRASS-dev] Re: Re: wxgrass won't work - how to set up digitization?

Glynn Clements

Moritz Lennert wrote:

> > 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 <[hidden email]>

_______________________________________________
grassgui mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/grassgui
Reply | Threaded
Open this post in threaded view
|

Re: [GRASS-dev] Re: Re: wxgrass won't work - how to set up digitization?

Martin Landa
In reply to this post by Moritz Lennert
Hi,

2007/8/20, Moritz Lennert <[hidden email]>:

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

> 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

> Moritz
>
> _______________________________________________
> grass-dev mailing list
> [hidden email]
> http://grass.itc.it/mailman/listinfo/grass-dev
>


--
Martin Landa <[hidden email]> * http://gama.fsv.cvut.cz/~landa *

_______________________________________________
grassgui mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/grassgui
Reply | Threaded
Open this post in threaded view
|

Re: [GRASS-dev] Re: Re: wxgrass won't work - how to set up digitization?

Glynn Clements

Martin Landa wrote:

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

> C++
> because wxWidgets is written in C++! It shouldn't case any problems.
>
> > 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 <[hidden email]>

_______________________________________________
grassgui mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/grassgui
Reply | Threaded
Open this post in threaded view
|

Re: [GRASS-dev] Re: Re: wxgrass won't work - how to set up digitization?

Martin Landa
Hi,

2007/8/22, Glynn Clements <[hidden email]>:

>
> Martin Landa wrote:
>
> > > 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 <[hidden email]> * http://gama.fsv.cvut.cz/~landa *

_______________________________________________
grassgui mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/grassgui
Reply | Threaded
Open this post in threaded view
|

Re: [GRASS-dev] Re: Re: wxgrass won't work - how to set up digitization?

Glynn Clements

Martin Landa wrote:

> > > > 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 <[hidden email]>

_______________________________________________
grassgui mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/grassgui