Subject: [Thuban-list] No geodata output

From: Alexander Pucher <[email-masked]>
Date: Tue, 18 Mar 2003 17:06:41 +0100

Hi,

first of all, congratiolations to everybody involved in the Thuban 
project for this nice piece of software.  I guess this is what a lot of 
people are looking for as a kind of missing link in the freegis scene!!

I compiled Thuban on my Linux machine with no errors showing. I can 
start the application, the windows look fine. But when I try to add a 
layer, I get this error:

File "/usr/local//lib/thuban/Thuban/UI/mainwindow.py", line 209, in 
invoke_command
    command.Execute(self.Context())
  File "/usr/local//lib/thuban/Thuban/UI/command.py", line 121, in Execute
    apply(self.function, (context,) + self.args + args, kw)
  File "/usr/local//lib/thuban/Thuban/UI/mainwindow.py", line 582, in 
call_method
    apply(getattr(context.mainwindow, methodname), args)
  File "/usr/local//lib/thuban/Thuban/UI/mainwindow.py", line 385, in 
AddLayer
    layer = Layer(title, filename)
  File "/usr/local//lib/thuban/Thuban/Model/layer.py", line 150, in __init__
    self.__setClassLock = False
NameError: global name 'False' is not defined

and nothing shows up??

Any hints?

Best regards,
alex

-- 
________________________________________________________

Institut fuer Geographie und Regionalforschung
Universitaet Wien
Kartografie und Geoinformation

Departement of Geography and Regional Research
University of Vienna
Cartography and GIS

Universitaetstr. 7, A-1010 Wien, AUSTRIA

Tel: (+43 1) 4277 48644
Fax: (+43 1) 4277 48649
E-mail: [email-masked]

FTP: ftp://ftp.gis.univie.ac.at
WWW: http://www.gis.univie.ac.at/karto
--------------------------------------------------------
Virtual Map Forum: http://www.gis.univie.ac.at/vmf
--------------------------------------------------------
It's not that I'm afraid to die, 
I just don't want to be there when it happens -- Woody Allen

---

From: Jonathan Coles <[email-masked]>
Date: 18 Mar 2003 17:15:27 +0100

which version of Python are you using? you will need at least version
2.2

--jonathan

-- 
Jonathan Coles
Intevation GmbH
http://www.intevation.de

---

From: Alexander Pucher <[email-masked]>
Date: Tue, 18 Mar 2003 17:25:59 +0100

Hi Jonathan,

I use version 2.2-105

alex

Tel: (+43 1) 4277 48644
Fax: (+43 1) 4277 48649

---

From: Jonathan Coles <[email-masked]>
Date: 18 Mar 2003 17:32:45 +0100

alex,

i have run the following test:

jonathan@salmakis:~$ python2.1
Python 2.1.3 (#1, Sep  7 2002, 15:29:56)
[GCC 2.95.4 20011002 (Debian prerelease)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> x = False
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
NameError: name 'False' is not defined

jonathan@salmakis:~$ python2.2
Python 2.2.1 (#1, Sep  7 2002, 14:34:30)
[GCC 2.95.4 20011002 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> x = False
>>> x
0

have you built your version of python from the source or are you running
prebuilt binaries?

--jonathan

-- 
Jonathan Coles
Intevation GmbH
http://www.intevation.de

---

From: Alexander Pucher <[email-masked]>
Date: Tue, 18 Mar 2003 17:41:52 +0100

I just took it off from the SuSe DVD.

Thi sis my output:

pucher@david:/download/Thuban-0.2.0/test> python
Python 2.2 (#1, Mar 26 2002, 15:46:04)
[GCC 2.95.3 20010315 (SuSE)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

mfg
alex

Tel: (+43 1) 4277 48644
Fax: (+43 1) 4277 48649

---

From: Jan-Oliver Wagner <[email-masked]>
Date: Tue, 18 Mar 2003 18:21:55 +0100

> NameError: name 'False' is not defined

According to the Python documentation False and True were
introduced in Python 2.3 and backported to version 2.2.1.

Thus Alex discovered, that Thuban has the requirement
Python 2.2.1 instead of just Python 2.2.

Either you have to install the newer version or you can
add something like
False = 0
True = 1
in the code.

We'll have to fix this problem: We should make Python 2.2.1 an
official requirement. I don't think we should work around 
False/True in case 2.2 is used to execut Thuban.
Any other opinions?

	Jan

-- 
Jan-Oliver Wagner               http://intevation.de/~jan/

Intevation GmbH	              	     http://intevation.de/
FreeGIS	                               http://freegis.org/

---

From: Jonathan Coles <[email-masked]>
Date: 18 Mar 2003 18:29:45 +0100

ok, apparently, we have made a mistake in the version that Thuban
depends on. I thought that the boolean values were defined in 2.2 when
in fact they are defined in 2.2.1. you will need to use the 2.2.1
package. sorry about this.

http://at.rpmfind.net/opsys/linux/RPM/python.html

--jonathan

-- 
Jonathan Coles
Intevation GmbH
http://www.intevation.de

---

From: Bernhard Reiter <[email-masked]>
Date: Wed, 19 Mar 2003 10:27:30 +0100

> False/True in case 2.2 is used to execut Thuban.

We might add a workaround faq.
We should add a couple of tests which test the required
version numbers and put out warning for
	wxPython
	wxGTK
	Python
	pyshapelip
	proj
if possible

---

From: Jan-Oliver Wagner <[email-masked]>
Date: Wed, 19 Mar 2003 11:59:26 +0100

> version numbers and put out warning for

I suggest to add a test on existance of False and True
and to add a recommendation to execute runtests after installation.

This recommendation should appear on the download web page, and
in the README file. 

Jonathan, can you do that?

---

From: Bernhard Reiter <[email-masked]>
Date: Wed, 19 Mar 2003 12:01:00 +0100

> and to add a recommendation to execute runtests after installation.

We should also simply test on the version numbers
of the various components in question.

---

From: Jonathan Coles <[email-masked]>
Date: 19 Mar 2003 12:05:48 +0100

i'm writing some tests now that will run before Thuban starts. then i'll
make the changes to the README and the website.

--jonathan

-- 
Jonathan Coles
Intevation GmbH
http://www.intevation.de

---

From: Alexander Pucher <[email-masked]>
Date: Wed, 19 Mar 2003 12:57:01 +0100

Hi,
thanks for the help so far.

Ok, I upgraded to 2.2.1, so now I'm running:

GTK 2.0.6
Phyton 2.2.1
Python-xml 2.2
wxWindows 2.4
wxPython 2.4
proj 4.4.5

Application starts, I can add the data layer 'cultural_landmark-point' 
from the Thuban-data iceland sample data. When adding anothr layer from 
the dataset, or any other layer, or trying to open a saved session (e.g. 
from the iceland demo) the application crashes!!

No error output, only 'Segmentation fault'.

mfg
alex

Tel: (+43 1) 4277 48644
Fax: (+43 1) 4277 48649

---

From: Bernhard Herzog <[email-masked]>
Date: 19 Mar 2003 13:46:53 +0100

> version numbers and put out warning for
[...]
> 	pyshapelip

We don't need a test for this. All of shapelib needed for thuban is
included in Thuban.

   Bernhard H.

-- 
Intevation GmbH                                 http://intevation.de/
Sketch                                 http://sketch.sourceforge.net/
MapIt!                                           http://www.mapit.de/

---

From: Jonathan Coles <[email-masked]>
Date: 19 Mar 2003 14:22:34 +0100

this appears to be a library problem. if you are compiling Thuban you
have to be careful which version of gcc you use. it must be the same
version that was used to compile the wxWindows libraries. my bet is that
Thuban crashes when it tries to draw the polygon layers using the proj
library. there is some C++ code included with Thuban which calls into
wxWindows code and if the compilers are not the same then the name
mangling will be different.

if you want to test this theory try doing this:

in file Thuban/UI/renderer.py on line 135 comment out the call to
self.draw_polygon_shape() and add "pass" so that the "if" block looks
like this:

            if shapetype == SHAPETYPE_POINT:
                self.dc.SetBrush(brush)
                self.dc.SetPen(pen)
                self.draw_point_shape(layer, i)
            else:
                pass #self.draw_polygon_shape(layer, i, pen, brush)

when you compile/run Thuban you should be able to load the
iceland_sample.thuban file. All the information about the session should
appear in the session tree but none of the polygon layers will be
visible.

--jonathan

-- 
Jonathan Coles
Intevation GmbH
http://www.intevation.de