mapscript,as an egg
C Python
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


.. contents::

Makina Corpus sponsorised software

* `Planet Makina Corpus <>`_
* `Contact us <>`_

.. |makinacom| image::
.. _makinacom:

Python MapScript for MapServer 5.0 README

:Author: Howard Butler
:Author: Sean Gillies
:Revision: $Revision: 6560 $
:Date: $Date: 2007-08-11 21:41:45 -0500 (Sat, 11 Aug 2007) $

The Python mapscript module provides users an interface to MapServer
classes on any platform, and has been well tested on Python versions

Building the Mapscript Module

Before you begin, it's worth spending a few minutes to read the
docs about Python distutils:

Now that you know what distutils does, use it like

    $ python build

Building C Extension Wrappers

If you are building the mapscript module from CVS, not from a release, the
C extension wrappers will be absent and must then be generated using SWIG,
the Simplified Wrapper and Interface Generator,  SWIG
version 1.3.29 or higher is recommended.

From the mapscript/python directory execute

    $ swig -python -shadow -o mapscript_wrap.c ../mapscript.i

and then proceed to the build step explained above.  If you are using
Python 2.2 or 2.3, you should add a -modern option which produces a higher
performance module.  ::

    $ swig -python -shadow -modern -o mapscript_wrap.c ../mapscript.i

If you have SWIG version 1.3.31 or greater, you can add in some of SWIG's 
optimizations to squeeze more performance out of the bindings ::

    $ swig -python -shadow -modern -templatereduce -fastdispatch -fvirtual -fastproxy 
      -modernargs -castmode -dirvtable -fastinit -fastquery -noproxydel -nobuildnone 
      -o mapscript_wrap.c ../mapscript.i

Make the appropriate edits to tests/ under the mapserver directory,
change directory from mapscript/python and execute ::

    $ cd tests/cases
    $ python -v

The tests can (and should) be run before the module is installed.


As root or superuser
    $ python install

That's it!

Steve Lime (developer)
Sean Gillies (developer)
Frank Warmerdam (developer)
Howard Butler (developer)
Norman Vine (cygwin and distutils guru)
Tim Cera (install)
Michael Schultz (documentation)

MapScript is now using code from gdmodule

which makes possible some new and cool imageObj tricks.  The use
this code is **greatly** appreciated and MapServer developers look
forward to being able to share advances with the gdmodule