2011-08-23 18:10:52 +00:00
|
|
|
# Mapnik Installation
|
2006-01-31 23:09:52 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
Mapnik is cross platform and runs on Linux, Mac OSX, Solaris, *BSD, and Windows.
|
2005-06-15 20:50:02 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
To configure and build Mapnik do:
|
2008-04-15 07:24:52 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
./configure
|
|
|
|
make
|
2013-01-15 18:50:02 +00:00
|
|
|
|
2013-03-22 21:14:36 +00:00
|
|
|
NOTE: the above will not work on windows, rather see https://github.com/mapnik/mapnik/wiki/WindowsInstallation
|
2013-01-15 18:50:02 +00:00
|
|
|
|
|
|
|
Then to run the tests locally (without needing to install):
|
|
|
|
|
|
|
|
make test-local
|
|
|
|
|
|
|
|
Install like:
|
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
sudo make install
|
2009-03-31 17:46:05 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
If you need to uninstall do:
|
2009-03-31 17:46:05 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
sudo make uninstall
|
2008-04-15 07:24:52 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
For more details see the `Building` Section below.
|
2008-04-15 07:24:52 +00:00
|
|
|
|
2012-08-16 19:27:58 +00:00
|
|
|
Platform specific install guides at https://github.com/mapnik/mapnik/wiki/Mapnik-Installation
|
2009-02-26 23:46:19 +00:00
|
|
|
|
2012-08-16 19:27:58 +00:00
|
|
|
For troubleshooting help see https://github.com/mapnik/mapnik/wiki/InstallationTroubleshooting
|
2009-02-26 23:46:19 +00:00
|
|
|
|
2008-04-15 07:24:52 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
## Depends
|
2008-11-14 23:25:17 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
Build system dependencies are:
|
2010-01-11 19:39:59 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
* C++ compiler (like g++ or clang++)
|
|
|
|
* >= 2 GB RAM
|
2013-01-15 18:50:02 +00:00
|
|
|
* Python 2.4-2.7
|
|
|
|
* Scons (a copy is bundled)
|
2008-11-14 23:25:17 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
Mapnik Core depends on:
|
2008-04-15 07:24:52 +00:00
|
|
|
|
2012-01-08 23:55:47 +00:00
|
|
|
* Boost
|
2012-05-25 00:07:56 +00:00
|
|
|
- >= 1.47 is required.
|
2013-01-15 18:50:02 +00:00
|
|
|
- These libraries are used:
|
2012-01-08 23:55:47 +00:00
|
|
|
- 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)
|
2011-08-23 18:10:52 +00:00
|
|
|
* libicuuc >= 4.0 (ideally >= 4.2) - International Components for Unicode
|
2013-01-15 18:50:02 +00:00
|
|
|
* libz - Zlib compression
|
|
|
|
* libfreetype - Freetype2 for font support (Install requires freetype-config)
|
2011-08-23 18:10:52 +00:00
|
|
|
* libxml2 - XML parsing (Install requires xml2-config)
|
2013-07-19 05:09:17 +00:00
|
|
|
|
|
|
|
Mapnik Core optionally depends on:
|
|
|
|
|
|
|
|
* libpng >= 1.2.x - PNG graphics (Default enabled, if found)
|
|
|
|
* libjpeg - JPEG graphics (Default enabled, if found)
|
|
|
|
* libtiff - TIFF graphics (Default enabled, if found)
|
|
|
|
* libwebp - WEBP graphics (Default enabled, if found)
|
|
|
|
* libproj - PROJ.4 projection library (Default enabled, if found)
|
2008-04-15 07:24:52 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
Mapnik Python bindings depend on:
|
2009-02-01 20:32:23 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
* Python 2.5-2.7 or >= 3.2
|
2011-08-23 18:10:52 +00:00
|
|
|
* Boost python
|
2013-09-18 23:08:34 +00:00
|
|
|
* simplejson module if using <= 2.5
|
2006-01-31 23:09:52 +00:00
|
|
|
|
2013-07-19 05:09:17 +00:00
|
|
|
Note: Python 3.x is supported, see: https://github.com/mapnik/mapnik/wiki/Python3k
|
2013-01-15 18:50:02 +00:00
|
|
|
|
2013-07-19 05:09:17 +00:00
|
|
|
Additional optional dependencies:
|
2006-01-31 23:09:52 +00:00
|
|
|
|
2013-05-24 23:45:02 +00:00
|
|
|
* Cairo >= 1.6.0 - Graphics library for output formats like PDF, PS, and SVG
|
2009-02-01 20:32:23 +00:00
|
|
|
- pkg-config - Required for building with cairo support
|
2009-02-01 20:54:55 +00:00
|
|
|
- pycairo - Python bindings for cairo
|
2013-06-07 15:38:30 +00:00
|
|
|
* PostgreSQL (for PostGIS plugin support)
|
|
|
|
- libpq - PostreSQL libraries
|
|
|
|
- pg_config - PostgreSQL installation capabilities
|
2011-08-23 18:10:52 +00:00
|
|
|
* libgdal - GDAL/OGR input (For gdal and ogr plugin support)
|
2013-01-15 18:50:02 +00:00
|
|
|
* libsqlite3 - SQLite input (needs RTree support builtin) (sqlite plugin support)
|
2011-08-23 18:10:52 +00:00
|
|
|
* libocci - Oracle input plugin support
|
|
|
|
* libcurl - OSM input plugin support
|
2013-08-29 14:52:39 +00:00
|
|
|
* librasterlite - Rasterlite input plugin support
|
2005-06-15 20:50:02 +00:00
|
|
|
|
2010-10-02 12:30:53 +00:00
|
|
|
Instructions for installing many of these dependencies on
|
2013-01-15 18:50:02 +00:00
|
|
|
various platforms can be found at the Mapnik Wiki:
|
2008-04-15 07:24:52 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
https://github.com/mapnik/mapnik/wiki/Mapnik-Installation
|
2008-04-15 07:24:52 +00:00
|
|
|
|
2005-06-15 20:50:02 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
## Building
|
2006-04-14 03:45:46 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
The build system uses SCons, a pure python equivalent to autotools or cmake.
|
2006-01-31 23:09:52 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
We provide a simple Makefile wrapper that can be used like:
|
2006-01-31 23:09:52 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
./configure && make && make install
|
2006-01-31 23:09:52 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
For help on what options are accepted do:
|
|
|
|
|
|
|
|
./configure --help
|
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
To interact with the local copy of scons directly you can do:
|
2006-01-31 23:09:52 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
python scons/scons.py configure
|
2006-01-31 23:09:52 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
You can also use a globally installed scons:
|
2008-11-14 23:25:17 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
scons configure
|
2009-02-01 20:32:23 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
If you want to clean your build do:
|
2006-01-31 23:09:52 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
make clean
|
2009-03-31 17:46:05 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
If you experience odd configure errors, try cleaning the configure caches:
|
2009-03-31 17:46:05 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
make distclean
|
2006-01-31 23:09:52 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
To install in a custom location do:
|
|
|
|
|
|
|
|
./configure PREFIX=/opt/mapnik
|
2008-04-15 07:24:52 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
To pass custom CXXFLAGS or LDFLAGS do:
|
2008-04-15 07:24:52 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
./configure CUSTOM_CXXFLAGS="-g -I/usr/include" CUSTOM_LDFLAGS="-L/usr/lib"
|
2006-01-31 23:09:52 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
To pass custom paths to a dependency, like boost, do:
|
2006-01-31 23:09:52 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
./configure BOOST_INCLUDES=/opt/boost/include BOOST_LIBS=/opt/boost/lib
|
2006-01-31 23:09:52 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
To pass custom paths to a dependency, like icu, do:
|
2006-01-31 23:09:52 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
./configure ICU_INCLUDES=/usr/local/include ICU_LIBS=/usr/local/include
|
2006-01-31 23:09:52 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
For more details on usage see:
|
2011-08-23 18:10:52 +00:00
|
|
|
|
2012-08-16 19:27:58 +00:00
|
|
|
https://github.com/mapnik/mapnik/wiki/UsingScons
|
2006-01-31 23:09:52 +00:00
|
|
|
|
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
## Testing Installation
|
2005-06-15 20:50:02 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
You can run the Mapnik tests locally (without installing) like:
|
2005-06-15 20:50:02 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
make test-local # see the Makefile for how this works
|
2009-02-01 20:32:23 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
Or you can install and test like:
|
2009-02-01 20:32:23 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
make install && make test
|
2009-02-01 20:32:23 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
Many of the tests are written in python and you can run them individually like:
|
2009-02-01 20:32:23 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
make install
|
|
|
|
python tests/python_tests/shapefile_test.py
|
2005-06-14 15:06:59 +00:00
|
|
|
|
2008-04-15 07:24:52 +00:00
|
|
|
|
2011-08-23 18:10:52 +00:00
|
|
|
## Learning Mapnik
|
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
### Help
|
2011-08-23 18:10:52 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
Mapnik has an active community of talented users and developers making beautiful maps.
|
2011-08-23 18:10:52 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
If you need help or want to participate starting points include:
|
2008-04-15 07:24:52 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
- Sign up and post to the mailing list: http://mapnik.org/contact/
|
|
|
|
- Join and ask questions on the #mapnik channel on irc://irc.freenode.net/mapnik
|
|
|
|
- Add your help questions to https://github.com/mapnik/mapnik-support
|
2009-02-01 20:32:23 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
### Cartographers
|
2009-02-01 20:32:23 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
TileMill, which uses Mapnik internally, offers great step by step tutorials for
|
|
|
|
learning advanced map styling: http://mapbox.com/tilemill/docs/crashcourse/introduction/
|
2009-02-01 20:32:23 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
### Programmers
|
2009-02-01 20:32:23 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
Mapnik is great for building your own mapping applications. Visit
|
|
|
|
https://github.com/mapnik/mapnik/wiki/LearningMapnik for basic
|
|
|
|
tutorials on how to programmatically use Mapnik.
|
2009-02-01 20:32:23 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
### Contributers
|
2008-04-15 07:24:52 +00:00
|
|
|
|
2013-01-15 18:50:02 +00:00
|
|
|
Read docs/contributing.markdown for resources for getting involved with Mapnik development.
|