[#694] A couple of uncaught exceptions with umn_mapserver

Date:
2008-07-24 23:42
Priority:
3
State:
Open
Submitted by:
Anthony Lenton (elachuni)
Assigned to:
Anthony Lenton (elachuni)
Category:
none
Version:
none
Resolution:
none
Summary:
A couple of uncaught exceptions with umn_mapserver

Detailed description
Hello,

Playing around with the umn_mapserver extension throws a couple exceptions that
probably should be handled with warning dialogs:

1) If you attempt to export the map before setting its size, you get an
uncaught exception. To reproduce this traceback:
* Open Thuban
* Click on Experimental->MapServer->Create new mapfile
* Click on Experimental->MapServer->Export mapfile
* Enter any filename, and click Ok.

An unhandled exception occurred:
msCalculateScale(): General error message. Invalid image extent, minx=nan, miny=nan, maxx=nan, maxy=nan.
(please report to http://thuban.intevation.org/bugtracker.html)

Traceback (most recent call last):
File "/home/anthony/svn/thuban/trunk/thuban/Thuban/UI/mainwindow.py", line 300, in invoke_command
command.Execute(self.Context())
File "/home/anthony/svn/thuban/trunk/thuban/Thuban/UI/command.py", line 121, in Execute
apply(self.function, (context,) + self.args + args, kw)
File "/home/anthony/svn/thuban/trunk/thuban/Extensions/umn_mapserver/mf_export.py", line 163, in export_mapfile
thuban_to_map(context, theMap)
File "/home/anthony/svn/thuban/trunk/thuban/Extensions/umn_mapserver/mf_export.py", line 104, in thuban_to_map
map.set_extent(tb_bbox)
File "/home/anthony/svn/thuban/trunk/thuban/Extensions/umn_mapserver/mapfile.py", line 1027, in set_extent
newextent[2],newextent[3])
File "/usr/lib/python2.5/site-packages/mapscript.py", line 1275, in setExtent
def setExtent(*args): return _mapscript.mapObj_setExtent(*args)
MapServerError: msCalculateScale(): General error message. Invalid image extent, minx=nan, miny=nan, maxx=nan, maxy=nan.

Checking the code in mapfile.py there seems to be an attempt to fix this by
doing:
if self.get_size()[0] == - 1:
print "define the size first to set extent"
print "size is now set to (1,1)"
self.set_size(1,1)

just before setting the map extent. It seems that this isn't enough on all
platforms to avoid set_extent to fail.

2) If you attempt to enter non-numeric characters in the size field of the
map configuration dialog you get an uncaught exception. To reproduce this:
* Open Thuban
* Click on Experimental->MapServer->Create new mapfile
* Click on Experimental->MapServer->Edit mapfile->Map
* Enter anything that isn't a number in width or height field.

An unhandled exception occurred:
invalid literal for int() with base 10: '-1g'
(please report to http://thuban.intevation.org/bugtracker.html)

Traceback (most recent call last):
File "/home/anthony/svn/thuban/trunk/thuban/Extensions/umn_mapserver/mf_handle.py", line 217, in OnOK
self.tb_map_umn.set_size(int(self.text_width.GetValue()),
ValueError: invalid literal for int() with base 10: '-1blah'

No comments have been posted

No attached documents

Field Old Value Date By
assigned_tonone2008-07-27 05:58Anthony Lenton