[mapserver-users] Python mapscript, cStringIO, and the AGG renderer
Roger André
randre at gmail.com
Sun Feb 1 11:01:28 PST 2009
Hi All,
I'm having problems using the AGG renderer with Python mapscript. I believe
it may be due to the way in which I am writing the image into a
cStringIO.StringIO() object, but I'm not sure. I do know that if I comment
out my OUTPUTFORMAT section of the mapfile, I get an image back in my
browser. I'm hoping I can fix this somehow with a FORMATOPTION.
- Below is the mapscript and Python CGI:
#! /usr/bin/python
import mapscript
import cStringIO
def DrawMap():
mapfile = "/var/www/mapfiles/gis_layers/gis_layers.map"
mapobject = mapscript.mapObj(mapfile)
mapimage = mapobject.draw()
f = cStringIO.StringIO()
mapimage.write(f)
print "Content-type: image/png\n"
f.seek(0)
print f.read()
print mapimage
if __name__ == "__main__":
DrawMap()
- And here is the OUTPUTFORMAT section that's causing the problem:
OUTPUTFORMAT
NAME 'AGG'
DRIVER AGG/PNG
IMAGEMODE RGB
END
Thanks,
Roger
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090201/67d29b14/attachment.htm>
More information about the MapServer-users
mailing list