Skip to content

MacInstallationPorts

ThomasG77 edited this page Dec 27, 2011 · 2 revisions

Installing Mapnik on Mac OS X

This page describes how to build/install Mapnik from source on Mac OS X >= 10.5, using Macports.

Unlike the MacInstallation guide, this page assumes you grok the command-line.

Dependencies

Run

    $ sudo port install proj libpng jpeg tiff icu jam
    $ sudo port install boost +python25 +icu

For optional dependencies (such as Cairo or PostGIS), see MacInstallation/Optional (MacInstallation_Optional)

Building

Grab source:

    $ git clone https://github.com/mapnik/mapnik.git

Patch SConstruct (get SConstruct.osx.patch, download here)

    $ patch -p1 < SConstruct.osx.patch

Compile/Install

    $ cd mapnik
    $ python scons/scons.py DEBUG=y
    $ sudo python scons/scons.py install DEBUG=y

Add the following line to your ~/.profile

    export PYTHONPATH="/usr/lib/python2.5/site-packages"

Testing

    $ python
    >>> import mapnik
    registered datasource : gdal
    registered datasource : postgis
    registered datasource : raster
    registered datasource : shape
    >>> dir(mapnik) # This gets you a list of symbols
    ['BoostPythonMetaclass', 'Color', 'Coord', 'CreateDatasource', ...]
    >>> help(mapnik)

References

Clone this wiki locally