14.2. Getting MapScript

 < Day Day Up > 

How do you get MapScript? There are variety of methods, some easier than others. The common requirement for running MapScript is that the scripting language itself must be available. The header files for the language may also be required if building the MapScript modules from source code.

14.2.1. Building MapScript from Source Code

Building MapScript from source for each language isn't detailed here, but there is a common approach.

To build MapScript for a language, support for that language must have been configured and built into MapServer itself when it was compiled. This sets up the various files in the MapScript language folders that are needed for the next step.

The MapServer source code directory structure includes a folder called mapscript. This folder has subsequent folders for each language that has some form of MapScript support. The folder may have a Makefile that is ready to be used by the make command, or it may have some setup scripts. Running these produces MapScript modules or libraries (depending on the language), and the scripts can often be used to help install them too. For example, with Python, you build and then install MapScript by running:

 > python setup.py build > python setup.py install

There are several other files and directories that are part of the Simplified Wrapper and Interface Generator (SWIG) environment. SWIG is used to port MapScript to certain languages. This is now the standard method for producing a MapScript extension for additional languages. If you are familiar with SWIG and want to write a mapscript_wrap.c file for a new language, your contributions would be more than welcome. For more information on SWIG, see http://www.swig.org.

Compilation instructions are included in README files in the specific MapScript language folder. More information can be found in the MapScript and Reference Guides sections of the MapServer documentation page at http://mapserver.gis.umn.edu/doc.html.

14.2.2. Obtaining Binary Versions of MapScript

Binary versions of MapScript are also available, depending on the programming language. The best place to get some personal direction is from the MapServer mailing list. These sites distribute various forms of MapScript:

  • DM Solutions has PHP MapScript binaries available at http://maptools.org/php_mapscript/index.phtml.

  • It is also available as part of the MapServer for Windows (MS4W) environment at http://maptools.org/ms4w/index.phtml.

  • Frank Warmerdam's FWTools package includes Python MapScript. Windows and Linux platforms are supported. See http://fwtools.maptools.org.

  • The FGS project at http://www.maptools.org/fgs/ provides an installer for MapServer and PHP MapScript under Linux.

  • Howard Butler's Kitchen Sink build is available for the Windows operating system. It includes Java and Python support as well as several other libraries and utilities. You can find it at http://hobu.stat.iastate.edu/mapserver.

14.2.3. Getting Help

Many first-time MapScript users need some hand-holding to get started. The previous links and the MapServer mailing list are good places to go for support. This chapter will show some simple examples to help get you started.

     < Day Day Up > 


    Web Mapping
    Web Mapping Illustrated: Using Open Source GIS Toolkits
    ISBN: 0596008651
    EAN: 2147483647
    Year: 2005
    Pages: 138

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net