[mapserver-users] Fwd: Mapserver and Zope

Michael Schulz mschulz at webgis.de
Thu Sep 19 01:48:40 PDT 2002


Hi Jean-Francois and the other mapserver-zope Users,

we have set up our first small mapscript-zope application in a production
enivronment, unfortunately there is not much i can show, since what the user
sees is only a queryable map, no navigation and all the other things. But it
does do some things behind the curtain (create/modify shape/dbf-files, query a
MySQL-DB, draw layers with filters, etc. ). These things work now pretty stable.

I had also several problems with stability (seg faults), especially when
creating shapefile/dbf-files. These could be minimized by additionally using the
pyshapelib. The combination with zope has one problem we are facing at the
moment, that is when your mapscript external method crashes, ZOPE crashes too
(for those who don't know ZOPE this can mean the whole website is down).

I surely will look deeper into these problems and found one helpful little
python module, called WAD (wrapped application debugger). This module tries to
catch fatal errors and convert them in "normal" exceptions. If someone wants to
look at it: http://systems.cs.uchicago.edu/wad/

Cheers, Michael



Jean-Francois.Doyon at ccrs.nrcan.gc.ca schrieb:

> Hello,
>
> Thanks to Norman's help, I've finally got my python mapscript up and
> running.
>
> Now I just have one rather major concern. How stable is the module?  I mean,
> as far as thread safety and memory leaks?  I worry that loading such a
> complex module into zope could have consequences, especially as I keep
> hearing about the threading issues of libmap in relation to PHP. Does python
> suffer from the same problems?
>
> Anybody tested this? Or used it enough to know whether python mapscript can
> safely be used in a production zope environment?
>
> Any insight on this would be appreciated :)
>
> thanks,
> J.F.
>
> -----Original Message-----
> From: Sean Gillies [mailto:snchrstnglls at yahoo.com]
> Sent: Wednesday, September 18, 2002 2:27 PM
> To: jacobi at dfki.de; mapserver-users at lists.gis.umn.edu
> Subject: Re: [mapserver-users] Fwd: Mapserver and Zope
>
> Sven,
>
> I've seen and overcome each of these issues.
>
> Any Zope method that uses mapscript should be an
> external method because you'll need to access a
> map file on the filesystem.  As well, if you want
> to use the module 'sys', you'll need to make
> drawmap() into an external method.
>
> Next, you need to build mapscript using the same
> python version as comes with Zope.  If you're using
> Zope 2.5, you'll need to build python mapscript
> with python 2.1, and then install mapscript inside
> Zope's own python.  You can do this manually or by
> using a --prefix option with the setup.py script.
> Once you get a mapscript installed among your other
> Zope python modules, you should be ready to go.
>
> Now, the drawing errors: I experienced some problems
> like this with the 3.5 version of mapserver, and the
> problems went away when I moved up to mapserver 3.6
> and 3.7.  So, honestly, I didn't overcome this
> problem, but jumped over it.
>
> Hope this helps.  cheers,
> Sean
>
> --- Steve Lime <steve.lime at dnr.state.mn.us> wrote:
>
> > ATTACHMENT part TEXT message/rfc822
> > Date: Thu, 12 Sep 2002 13:52:35 +0200
> > From: Sven Jacobi <jacobi at dfki.de>
> > To: steve.lime at dnr.state.mn.us
> > Subject: Mapserver and Zope
> >
> > Hello,
> >
> > I've seen your mails in the lists of mapserver and I
> > have some
> > problems to which you (I hope so) could give me some
> > hints...
> >
> > I'm trying to use Mapserver in Zope which is Python
> > based.
> > I've already "swigged" the libraries to Python and
> > it seemed
> > to work.
> > But now I have got several problems:
> > 1.When I try to test Mapserver with Python, I get a
> > Segementation Fault
> >    when calling the draw()-function...below the
> > code:
> >
> > import sys
> > from mapscript import *
> >
> > def drawmap(width=400, height=300, align="left"):
> >  mymap = mapObj("/home/...")
> >  mymap.width=width
> >  mymap.height=height
> >  myimage=mymap.draw()
> >
> > drawmap()
> >
> > Is it possible that my Python-version isn't correct,
> > because it seems to
> > be an
> > error while changing to "C"...?
> >
> > 2. In Zope I always get an error because of failed
> > authorization. This
> > is independent of
> > the way I try it ( External Method or Python
> > Script).
> >
> > Have you any idea where these errors might come
> > from?
> >
> > I would be very glad to get an answer,
> >
> > thanks in forward,
> >
> > Cheers,
> >
> > Sven
> >
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! News - Today's headlines
> http://news.yahoo.com

--
-----------------------------------------------------------
Michael Schulz                                in medias res
Dipl.-Geologe                              Gesellschaft für
                                Informationstechnologie mbH
                             Sautierstr. 38, 79104 Freiburg
                                     0761 55695-95 (Fax 96)
mschulz at webgis.de                             www.webgis.de





More information about the MapServer-users mailing list