[Mapserver-users] 3.7 nightly and python/mapscript errors
Jerritt Collord
collord at linuxfund.org
Mon Apr 14 23:36:33 PDT 2003
> saveImage() is long gone from the nightly MapScript. Use save().
> Your script then would be something like:
Superb! works. The only documentation I could find was examples on this
list and I didn't know better that to try this obsoleted function.
Calling a function that doesn't exist certainly would produce a SWIG
error.
> Take a look at the latest (3.7) documentation regarding map
> outputformats and you'll see how to set the transparency and
> such to suit your needs.
Will do, thank you.
> Also, don't forget that the Python MapScript has a saveToString()
> method which Perl has not. Comes in handy when you'd like to
> have image data in memory rather than on disk.
>
> image_string = myimage.saveToString()
This is a cool feature.... but it segfaults for me. I can't make much
out of the strace.
Thanks,
Jerritt
>
> On Monday, April 14, 2003, at 07:04 PM, Jerritt Collord wrote:
>
> >
> > SWIG stuff I wouldn't know where to start tracking down! The mapfile
> > should be fine--I use it in all other interfaces okay--and it
> > doesn't smell like that kind of problem.
> >
> > Thanks,
> >
> > Jerritt
> >
> > gurgle:/usr/lib/cgi-bin# ./testpy.py
> > Traceback (most recent call last):
> > File "./testpy.py", line 14, in ?
> > drawmap()
> > File "./testpy.py", line 11, in drawmap
> > out = myimage.saveImage("euro.png",MS_PNG,50,0,50)
> > File "/usr/lib/python2.1/site-packages/mapscript.py", line 1770,
> > in<lambda> __getattr__ = lambda self, name: _swig_getattr(self,
> > imageObj, name) File
> > "/usr/lib/python2.1/site-packages/mapscript.py", line 19, in
> > _swig_getattr raise AttributeError,name AttributeError: saveImage
> >
> > gurgle:/usr/lib/cgi-bin# cat testpy.py
> > #!/usr/bin/python2.1
> > import mapscript
> > def drawmap():
> > mymap = mapscript.mapObj("/usr/lib/cgi-bin/maps/europe.map")
> > mymap.width=600
> > mymap.height=400
> > myimage=mymap.draw()
> > out = myimage.saveImage("euro.png",MS_PNG,50,0,50)
> > return out
> > drawmap()
> > _______________________________________________
> > Mapserver-users mailing list
> > Mapserver-users at lists.gis.umn.edu
> > http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> >
> >
> --
> Sean Gillies
> sgillies at frii.com
> http://www.frii.com/~sgillies
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
More information about the MapServer-users
mailing list