Problem with python mapscript

Sean Gillies sgillies at FRII.COM
Mon Aug 9 12:20:16 EDT 2004


On Aug 6, 2004, at 2:44 PM, Franco Brusatti wrote:

> Hi list:
>
>  I have a problem with python mapscrip. I use
>
>  MapServer version 4.2.2 OUTPUT=PNG OUTPUT=WBMP
> SUPPORTS=PROJ
> SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER INPUT=EPPL7
> INPUT=OGR INPUT=GDAL
> INPUT=SHAPEFILE
>
>  Python 2.3.4
>
>  to install i use this:
>
>  $> swig -python -modern -o mapscript_wrap.c
> .../mapscript.i
>  $> python setup.py build
>  $> su
>  $> python setup.py install
>
>
>  When run the test, obtain this:
>
>   $> python tests/testMapScript.py  -v
>
> ======================================================================
> ERROR: testDrawLargeJPEG
> (__main__.DrawLargeJPEGTestCase)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "tests/testMapScript.py", line 422, in
> testDrawLargeJPEG
>     self.mapobj1.setImageType('JPEG')
>   File "build/lib.linux-i686-2.3/mapscript.py", line
> 1757, in setImageType
>     def setImageType(*args): return
> _mapscript.mapObj_setImageType(*args)
> MapServerError: setImageType(): General error message.
> Unable to find
> IMAGETYPE 'JPEG'.
>
> ======================================================================
> ERROR: testConstructorUrlStream
> (__main__.ImageObjTestCase)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "tests/testMapScript.py", line 822, in
> testConstructorUrlStream
>     imgobj = mapscript.imageObj(0, 0, 'GD/JPEG', url)
>   File "build/lib.linux-i686-2.3/mapscript.py", line
> 1837, in __init__
>     _swig_setattr(self, imageObj, 'this',
> _mapscript.new_imageObj(*args))
> MapServerError: msLoadImageGDStream(): GD library
> error. Unable to
> initialize image
>
> ======================================================================
> FAIL: numpoints is immutable, this should raise error
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "tests/testMapScript.py", line 690, in
> testAlterNumPoints
>     self.assertRaises(AttributeError, setattr,
> self.line, 'numpoints', 3)
>   File "/usr/lib/python2.3/unittest.py", line 295, in
> failUnlessRaises
>     raise self.failureException, excName
> AssertionError: AttributeError
>
> ======================================================================
> FAIL: testRemoveOutputFormat may error without GDAL
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "tests/testMapScript.py", line 988, in
> testRemoveOutputFormat
>     assert num == 6, num
> AssertionError: 5
>
> ----------------------------------------------------------------------
> Ran 115 tests in 2.380s
>
> FAILED (failures=2, errors=2)
>

This errors occur because you have not configured MapServer for JPEG
output.  I suggest that you re-configure, you will eventually want
to use JPEG as well as PNG.

BTW, the ZMapServer does not yet work with MapServer 4.2.  Soon ...

cheers,
Sean



More information about the mapserver-users mailing list