mapscript.mapObj(map_path+map_file)

James McManus McManus jmpmcmanus at YAHOO.COM
Tue Jul 31 22:16:44 EDT 2007


In the past I was able to run python mapscripts, but recently I have been getting a strange error when running scripts:

[Tue Jul 31 21:45:58 2007] [error] [client 71.241.222.127] Traceback (most recent call last):
[Tue Jul 31 21:45:58 2007] [error] [client 71.241.222.127]   File "/var/www/cgi-bin/check.py", line 8, in <module>
[Tue Jul 31 21:45:58 2007] [error] [client 71.241.222.127]     map =  mapscript.mapObj(map_path+map_file)
[Tue Jul 31 21:45:58 2007] [error] [client 71.241.222.127]   File "/usr/lib64/python2.5/site-packages/mapscript.py", line 1219, in __init__
[Tue Jul 31 21:45:58 2007] [error] [client 71.241.222.127]     this = _mapscript.new_mapObj(*args)
[Tue Jul 31 21:45:58 2007] [error] [client 71.241.222.127] _mapscript.MapServerError: msInitGDALOutputFormat(): General error message. No GDAL driver named `GTiff' available.
[Tue Jul 31 21:45:58 2007] [error] [client 71.241.222.127] Premature end of script headers: check.py

-----------------------------------------------------------------------------------------------------------------------
check.py is a very simple test script:
#!/usr/bin/python

import mapscript, string
map_path = "/var/www/html/mapserver/"
map_file = "third.map"
input = open(map_path+map_file, 'r')
infile = input.readlines()
map =  mapscript.mapObj(map_path+map_file)
print "Content-type: text/html"
print
print "<html>"
print "<header><title>Python Mapscript Hello World</title></header>"
print "<body>"
print string.lower(infile[1])
print infile[1]
print map.extent
print "</body>"
print "</html>"

I am able to run this same script from my shell prompt, without getting an error. I am also able to run this script, from my server, if I comment out:

map =  mapscript.mapObj(map_path+map_file), and print map.extent

The error only occurs when I try to use mapscript.mapObj in a script being accessed through my server. Strange!!!

Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20070731/a652287b/attachment.html


More information about the mapserver-users mailing list