Python mapsctript documentation (Re: [Mapserver-users] (no subject))

Sean Gillies sgillies at frii.com
Fri Dec 6 16:51:35 EST 2002


Sven Jacobi wrote:
> Hi, 
> 
> is there any documentation about mapscript for Python
> available?
> 
> Cheers, 
> Sven
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> 
> 


Sven,

Which version are you using?  If you are using
the pre-release 3.7 version, there is a function
that you won't find in the Perl documentation.

The imagObj method saveToString() is very useful
for mapscript apps and can be used to make file-like
image objects.

import mapscript, StringIO

mymap = mapscript.mapObj('my.map')
myimage = map.draw()
myimagedata = myimage.saveToString()
myimagethingy = StringIO.StringIO(myimagedata)

Now you can use myimagethingy as an argument to other
Python methods that require a file object such as the
manage_addImage() method of a Zope folder, or the open()
method of the Python Imaging Library.

Otherwise, the Perl docs are a good start.

cheers,
Sean

--
Sean Gillies
sgillies at frii.com




More information about the mapserver-users mailing list