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
--
_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to