[#586] projection exception when changing projection

Date:
2008-01-25 08:29
Priority:
4
State:
Closed
Submitted by:
Didrik Pinte (dpinte)
Assigned to:
Bernhard Reiter (bernhard)
Category:
none
Version:
none
Resolution:
Accepted
Summary:
projection exception when changing projection

Detailed description
Hi,

Thanks to Stefanie <steffimaus.g@gmx.de>, the following bug has been discovered.

When trying to apply a projection to a loaded layer, the following exception occur :

An unhandled exception occurred:
list must contain strings
(please report to http://thuban.intevation.org/bugtracker.html)

Traceback (most recent call last):
File "/usr/lib/thuban/Thuban/UI/projdialog.py", line 233, in OnApply
self.__SetProjection()
File "/usr/lib/thuban/Thuban/UI/projdialog.py", line 555, in __SetProjection
self.receiver.SetProjection(self.__GetProjection())
File "/usr/lib/thuban/Thuban/UI/projdialog.py", line 578, in __GetProjection
return Projection(parameters, self.projname.GetValue())
File "/usr/lib/thuban/Thuban/Model/proj.py", line 80, in __init__
BaseProjection.__init__(self, params)
File "/usr/lib/thuban/Lib/Projection.py", line 5, in __init__
self.this = apply(Projectionc.new_Projection,args)
TypeError: list must contain strings

It seems to happen under all the 1.2.0 version (debian and windows).

Message  ↓
Date: 2008-01-26 22:24
Sender: Bernhard Reiter

Problem fixed with development version Revision 2816.

Steffi: If you do not want to wait for a new packaged version, you could start a text editor and do the following changes yourself to the file "projdialog.py" on your windows machine and installation:

http://wald.intevation.org/plugins/scmsvn/viewcvs.php/trunk/thuban/Thuban/UI/projdialog.py?root=thuban&rev=2816&r1=2700&r2=2816

Date: 2008-01-26 21:23
Sender: Bernhard Reiter

I can reproduce the problem, thanks to Didrik's instructions, he send me:

On Friday 25 January 2008 16:47, Didrik Pinte wrote:
> 1. launch thuban
> 2. Open session -> load Data/iceland_sample.thuban
> 3. Select political layer projection menu by right clicking on political
> layer
> 4. choose "Gauss-Krueger Zone 2 (Germany)" projection
> 5. click on button Try
>
> --> it should crash
>
> I've just seen that using "Geographic" projection did not crash. It
> seems the problem is related to text boxes (Latitude, longitude, etc.)
> that produce a unicode output.
>
> Can you reproduce it ?
>
> I can reproduce it with Debian 1.2.0-2 version, trunk version on Debian
> system, and Stefanie can do it on windows ;-)

Date: 2008-01-25 15:40
Sender: Bernhard Reiter

Steffi: Thanks for confirming the version.
Didrik: How did you reproduce the problem?
Can you give me a step by step documention, preferable
with a dataset I can also get somewhere (e.g. the Data from Thuban itself or frida?)

Date: 2008-01-25 15:34
Sender: Stefanie Gunkel

Hello,

I'm already using this version.

Steffi

Date: 2008-01-25 15:08
Sender: Didrik Pinte

Ok, the problem is related to the parameters given to Projectionc.new_Projection.

Unicode values are not supported.

How do we solve this ? Is this SWIG related ? or Proj related ?

Date: 2008-01-25 14:59
Sender: Didrik Pinte

More details :

In debugging, i have found the following problem using the latest svn version :

TypeError: list must contain strings
File "/home/did/projets/python/thuban/current/thuban/thuban.py", line 36, in ?
Thuban.UI.main.main()
File "/home/did/projets/python/thuban/current/thuban/Thuban/UI/main.py", line 45, in main
app.MainLoop()
File "/usr/lib/python2.4/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", line 7720, in MainLoop
wx.PyApp.MainLoop(self)
File "/usr/lib/python2.4/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", line 7153, in MainLoop
return _core_.PyApp_MainLoop(*args, **kwargs)
File "/home/did/projets/python/thuban/current/thuban/Thuban/UI/projdialog.py", line 233, in OnApply
self.__SetProjection()
File "/home/did/projets/python/thuban/current/thuban/Thuban/UI/projdialog.py", line 555, in __SetProjection
self.receiver.SetProjection(self.__GetProjection())
File "/home/did/projets/python/thuban/current/thuban/Thuban/UI/projdialog.py", line 578, in __GetProjection
return Projection(parameters, self.projname.GetValue())
File "/home/did/projets/python/thuban/current/thuban/Thuban/Model/proj.py", line 78, in __init__
BaseProjection.__init__(self, params)
File "/home/did/projets/python/thuban/current/thuban/Thuban/../Lib/Projection.py", line 6, in __init__
self.this = Projectionc.new_Projection(*args)

The argument of the last call is the following :

>>> args
(['proj=tmerc', u'lat_0=0.0', u'lon_0=6.0', u'x_0=2500000', u'y_0=0', u'k=1.0', 'ellps=bessel'],)

with some unicode strings ...

Could this be the problem ?
>>>

Date: 2008-01-25 11:06
Sender: Bernhard Reiter

I believe this problem has already be fixed in the development version.

Developers: Changelog entry from 2007-04-25 as the details.

Steffi: Can you try the development version thuban-1.2-svn20071002.exe.exe for windows
that you can download from the files section?

In any case: please add the information from the "Help-about" dialog to the report.

Thanks!

No attached documents

Field Old Value Date By
status_idOpen2008-01-26 22:24Bernhard Reiter
close_date2008-01-26 22:242008-01-26 22:24Bernhard Reiter
ResolutionNone2008-01-26 22:24Bernhard Reiter
assigned_tonone2008-01-26 21:23Bernhard Reiter
priority32008-01-26 21:16Bernhard Reiter
summaryprojection exception2008-01-26 21:16Bernhard Reiter
priority42008-01-25 14:59Didrik Pinte
summaryprojection exception when trying to change a projection of a layer2008-01-25 14:59Didrik Pinte
summaryprojection exception2008-01-25 11:07Bernhard Reiter
priority32008-01-25 10:48Bernhard Reiter