2011-08-23 20:10:52 +02:00
|
|
|
# Mapnik Installation
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2005-06-15 22:50:02 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
## Quick Start
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
To configure and build mapnik do:
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
./configure
|
|
|
|
make
|
|
|
|
sudo make install
|
2009-03-31 19:46:05 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
If you need to uninstall do:
|
2009-03-31 19:46:05 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
sudo make uninstall
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
For more details see the 'Building' Section below.
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
Platform specific install guides at http://trac.mapnik.org/wiki/MapnikInstallation
|
2009-02-27 00:46:19 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
For troubleshooting help see http://trac.mapnik.org/wiki/InstallationTroubleshooting
|
2009-02-27 00:46:19 +01:00
|
|
|
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
## Depends
|
2008-11-15 00:25:17 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
Mapnik is cross platform and runs on Linux, Mac OSX, Solaris, *BSD, and Windows.
|
2008-11-15 00:25:17 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
The build system should work for all posix/unix systems but for windows see:
|
2008-11-15 00:25:17 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
http://trac.mapnik.org/wiki/BuildingOnWindows
|
2010-01-11 20:39:59 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
Build dependencies are:
|
2010-01-11 20:39:59 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
* C++ compiler (like g++ or clang++)
|
|
|
|
* Python >= 2.4
|
|
|
|
* >= 2 GB RAM
|
2008-11-15 00:25:17 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
Mapnik Core depends on:
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2012-01-09 00:55:47 +01:00
|
|
|
* Boost
|
2012-01-09 01:08:08 +01:00
|
|
|
- >= 1.46 is recommended
|
|
|
|
- >= 1.45 is required if compiling with clang++
|
|
|
|
- >= 1.42 works on most systems and most compilers
|
|
|
|
- >= 1.47 is required to support wkt/wkb geometry output (optional)
|
2012-01-09 00:55:47 +01:00
|
|
|
- These libraries are required:
|
|
|
|
- filesystem
|
|
|
|
- system
|
|
|
|
- thread (if mapnik threadsafe support is required, default on)
|
|
|
|
- regex (optionally built with icu regex support)
|
|
|
|
- program_options (optionally for mapnik command line programs)
|
2009-02-27 00:46:19 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
* libicuuc >= 4.0 (ideally >= 4.2) - International Components for Unicode
|
|
|
|
* libpng >= 1.2.x - PNG Graphics
|
|
|
|
* libjpeg - JPEG Graphics
|
|
|
|
* libtiff - TIFF Graphics
|
|
|
|
* libz - Zlib Compression
|
|
|
|
* libfreetype - Freetype2 for Font support (Install requires freetype-config)
|
|
|
|
* libxml2 - XML parsing (Install requires xml2-config)
|
|
|
|
* libproj - PROJ.4 Projection library
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
Mapnik Python binding depend on:
|
2009-02-01 21:32:23 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
* Python >= 2.4
|
|
|
|
* Boost python
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
Optional dependencies:
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
* Cairo - Graphics library for PDF, PS, and SVG formats
|
2009-02-01 21:32:23 +01:00
|
|
|
- pkg-config - Required for building with cairo support
|
2011-08-23 20:10:52 +02:00
|
|
|
- libsigc++ - C++ support for cairomm
|
2009-02-01 21:54:55 +01:00
|
|
|
- cairomm - C++ bindings for cairo
|
|
|
|
- pycairo - Python bindings for cairo
|
2011-08-23 20:10:52 +02:00
|
|
|
* libpq - PostgreSQL libraries (For PostGIS plugin support)
|
|
|
|
* libgdal - GDAL/OGR input (For gdal and ogr plugin support)
|
|
|
|
* libsqlite3 - SQLite input (needs RTree support) (sqlite plugin support)
|
|
|
|
* libocci - Oracle input plugin support
|
|
|
|
* libcurl - OSM input plugin support
|
2005-06-15 22:50:02 +02:00
|
|
|
|
2010-10-02 14:30:53 +02:00
|
|
|
Instructions for installing many of these dependencies on
|
|
|
|
various platforms can be found at the Mapnik Community Wiki
|
|
|
|
(http://trac.mapnik.org/wiki/MapnikInstallation).
|
2008-04-15 09:24:52 +02:00
|
|
|
|
|
|
|
|
2005-06-15 22:50:02 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
## Building
|
2006-04-14 05:45:46 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
The build system uses SCons, a pure python equivalent to autotools or cmake.
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
We provide a simple Makefile wrapper that can be used like:
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
./configure && make && make install
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
To interact with the local copy of scons directly you can do:
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
python scons/scons.py configure
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
You can also use a globally installed scons:
|
2008-11-15 00:25:17 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
scons configure
|
2009-02-01 21:32:23 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
If you want to clean your build do:
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
make clean
|
2009-03-31 19:46:05 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
If you experience odd configure errors, try resetting the SCons caches:
|
2009-03-31 19:46:05 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
make reset
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
To install in a custom location do:
|
|
|
|
|
|
|
|
./configure PREFIX=/opt/mapnik
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
To pass custom CXXFLAGS or LDFLAGS do:
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
./configure CUSTOM_CXXFLAGS="-g -I/usr/include" CUSTOM_LDFLAGS="-L/usr/lib"
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
To pass custom paths to a dependency, like boost, do:
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
./configure BOOST_INCLUDES=/opt/boost/include BOOST_LIBS=/opt/boost/lib
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
To pass custom paths to a dependency, like icu, do:
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
./configure ICU_INCLUDES=/usr/local/include ICU_LIBS=/usr/local/include
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
If you want to see configure options do:
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
./configure --help
|
|
|
|
|
|
|
|
For more details on all the options see:
|
|
|
|
|
|
|
|
http://trac.mapnik.org/wiki/UsingScons
|
2006-02-01 00:09:52 +01:00
|
|
|
|
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
## Testing Installation
|
2005-06-15 22:50:02 +02:00
|
|
|
|
2010-10-02 14:30:53 +02:00
|
|
|
First, try importing the Mapnik python module in a python interpreter,
|
2011-08-23 20:10:52 +02:00
|
|
|
and make sure it does so without errors:
|
2005-06-15 22:50:02 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
$ python
|
|
|
|
Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17)
|
|
|
|
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
|
|
|
|
Type "help", "copyright", "credits" or "license" for more information.
|
|
|
|
>>> import mapnik
|
|
|
|
>>>
|
2009-02-01 21:32:23 +01:00
|
|
|
|
|
|
|
Then, try rendering the demo map, included in the Mapnik source code::
|
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
cd demo/python
|
|
|
|
python rundemo.py
|
2009-02-01 21:32:23 +01:00
|
|
|
|
2010-10-02 14:30:53 +02:00
|
|
|
If the resulting maps look good, this indicates the core components of
|
|
|
|
Mapnik are installed properly, as well as the Shapefile plugin, Unicode
|
|
|
|
text support (ICU), and re-projection support using Proj.
|
2009-02-01 21:32:23 +01:00
|
|
|
|
|
|
|
For further tests see the `tests` folder within the Mapnik source code.
|
2005-06-14 17:06:59 +02:00
|
|
|
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
## Learning Mapnik
|
|
|
|
|
|
|
|
### Users
|
|
|
|
|
|
|
|
Visit http://trac.mapnik.org/wiki/LearningMapnik for basic tutorials on making maps with Mapnik using the Python bindings.
|
|
|
|
|
|
|
|
### Developers
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
Visit http://trac.mapnik.org/#DevelopersCorner for resources for getting involved with Mapnik development.
|
2009-02-01 21:32:23 +01:00
|
|
|
|
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
## Mapnik Community
|
2009-02-01 21:32:23 +01:00
|
|
|
|
|
|
|
|
2010-10-02 14:30:53 +02:00
|
|
|
Mapnik has an active community of talented users and developers making
|
|
|
|
amazing maps.
|
2009-02-01 21:32:23 +01:00
|
|
|
|
2010-10-02 14:30:53 +02:00
|
|
|
If you are looking for further help on installation or usage and you can't
|
|
|
|
find what you are looking for from searching the users list archives
|
|
|
|
(http://lists.berlios.de/pipermail/mapnik-users/) or the trac wiki
|
|
|
|
(http://trac.mapnik.org/), feel free to join the Mapnik community and
|
|
|
|
introduce yourself.
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2009-02-01 21:32:23 +01:00
|
|
|
You can get involved by:
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
* Subscribing to the mapnik-users list:
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
http://lists.berlios.de/mailman/listinfo/mapnik-users
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
* Subscribing to the mapnik-developers list:
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
http://lists.berlios.de/mailman/listinfo/mapnik-devel
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
* Joining the #mapnik channel on irc://irc.freenode.net/mapnik
|
2008-04-15 09:24:52 +02:00
|
|
|
|
2011-08-23 20:10:52 +02:00
|
|
|
* Signing up as a user or contributor at http://www.ohloh.net/p/mapnik/
|