[thuban-Bugs][694] A couple of uncaught exceptions with umn_mapserver

thuban-bugs@wald.intevation.org thuban-bugs at wald.intevation.org
Fri Jul 25 01:42:58 CEST 2008


Bugs item #694, was opened at 2008-07-24 20:42
Status: Open
Priority: 3
Submitted By: Anthony Lenton (elachuni)
Assigned to: Nobody (None)
Summary: A couple of uncaught exceptions with umn_mapserver 
Resolution: None
Version: None
Category: None


Initial Comment:
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'



----------------------------------------------------------------------

You can respond by visiting: 
http://wald.intevation.org/tracker/?func=detail&atid=105&aid=694&group_id=6




More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)