Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 211 lines (134 sloc) 7.828 kb
d843a0e new build system
pavlenko authored
1 # $Id$
2
beb60b1 1. added installation instructions
pavlenko authored
3 INSTALLATION INSTRUCTIONS
4
072e35d applied patch from Dane Springmeyer
artem authored
5
6 Quick Start
7 -----------
8
9451084 touch up INSTALL doc
dane authored
9 For platform specific install guides see:
10
11 http://trac.mapnik.org/wiki/MapnikInstallation
12
040ef73 Further touchup of INSTALL formatting to make the code snippets valid…
dane authored
13 Install needed dependencies::
072e35d applied patch from Dane Springmeyer
artem authored
14
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
15 $ sudo apt-get install libboost* libicu* libfreetype* proj # see below for full list
040ef73 Further touchup of INSTALL formatting to make the code snippets valid…
dane authored
16 $ cd ~/src/mapnik
072e35d applied patch from Dane Springmeyer
artem authored
17
bfa054c fix typo in INSTALL doc
dane authored
18 Configure the build setup::
072e35d applied patch from Dane Springmeyer
artem authored
19
7ac14c3 Add notes about sqlite and the new 'configure' option for scons in tr…
dane authored
20 $ python scons/scons.py configure
21
22 Build Mapnik source code::
23
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
24 $ python scons/scons.py
040ef73 Further touchup of INSTALL formatting to make the code snippets valid…
dane authored
25
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
26 Install Mapnik library and python bindings::
040ef73 Further touchup of INSTALL formatting to make the code snippets valid…
dane authored
27
28 $ sudo python scons/scons.py install
29
f75e006 update INSTALL docs noting boost 1.41 and icu 1.4 requirements
dane authored
30 If on Linux then run:
31
32 $ sudo ldconfig
33
040ef73 Further touchup of INSTALL formatting to make the code snippets valid…
dane authored
34 Run python interpreter and check installation::
35
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
36 >>> import mapnik
040ef73 Further touchup of INSTALL formatting to make the code snippets valid…
dane authored
37 Traceback (most recent call last):
38 File "<stdin>", line 1, in <module>
39 ImportError: No module named mapnik
40 >>>
072e35d applied patch from Dane Springmeyer
artem authored
41
25fc713 Touched up to make INSTALL a valid reST format
dane authored
42 If you get this error ensure that Mapnik in is your PYTHONPATH.
072e35d applied patch from Dane Springmeyer
artem authored
43
25fc713 Touched up to make INSTALL a valid reST format
dane authored
44 Otherwise your setup is ready. You can now visit http://trac.mapnik.org/wiki/GettingStarted for a basic tutorial.
072e35d applied patch from Dane Springmeyer
artem authored
45
9451084 touch up INSTALL doc
dane authored
46 For help with using SCons see: http://trac.mapnik.org/wiki/UsingScons
7ac14c3 Add notes about sqlite and the new 'configure' option for scons in tr…
dane authored
47
48 For troubleshooting errors see: http://trac.mapnik.org/wiki/InstallationTroubleshooting.
072e35d applied patch from Dane Springmeyer
artem authored
49
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
50
beb60b1 1. added installation instructions
pavlenko authored
51 Prerequisites
d843a0e new build system
pavlenko authored
52 -------------
53
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
54 First, here is a quick list of the required software dependencies:
d843a0e new build system
pavlenko authored
55
56 - Linux/UNIX with g++ compiler
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
57 - Python 2.2 or greater to build Mapnik
58 - Python 2.4 for python bindings (see below)
f75e006 update INSTALL docs noting boost 1.41 and icu 1.4 requirements
dane authored
59 - libboost >= 1.41.0 or greater with the following libraries included:
60 - system
6afaa67 Fixed tabs and irc link in INSTALL document
dane authored
61 - thread
62 - filesystem
63 - regex
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
64 - iostreams
65 - python - required only for python bindings (see below)
f75e006 update INSTALL docs noting boost 1.41 and icu 1.4 requirements
dane authored
66 - libicu >= 1.4- International Components for Unicode
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
67 - libpng - PNG Graphics
68 - libjpeg - JPEG Graphics
69 - libtiff - TIFF Graphics
70 - libz - Compression
71 - libfreetype2 - Font support (Install requires freetype-config)
72 - libxml2 - XML parsing (Install requires xml2-config)
73 - proj - PROJ.4 Projection library
74
75 Second, here are the optional software dependencies:
beb60b1 1. added installation instructions
pavlenko authored
76
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
77 - Python 2.4 or greater for Python language bindings
78 - Boost 'python', required for binding Python language bindings
79 - Boost 'program_options' for shapeindex executable support
80 - Cairo - Graphics library for PDF, PS, and SVG formats
81 - pkg-config - Required for building with cairo support
6afaa67 Fixed tabs and irc link in INSTALL document
dane authored
82 - cairomm - C++ bindings for cairo
83 - pycairo - Python bindings for cairo
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
84 - libpq - PostgreSQL libraries (For PostGIS plugin support)
85 - libgdal - GDAL/OGR input (For gdal and ogr plugin support)
7ac14c3 Add notes about sqlite and the new 'configure' option for scons in tr…
dane authored
86 - libsqlite3 - SQLite input (needs RTree support) (sqlite plugin support)
9451084 touch up INSTALL doc
dane authored
87 - libocci - Oracle input plugin support
88 - libcurl - OSM input plugin support
beb60b1 1. added installation instructions
pavlenko authored
89
9451084 touch up INSTALL doc
dane authored
90 If your system does NOT have one of these installed, you will need to install the mandatory ones at the very least before proceeding further.
beb60b1 1. added installation instructions
pavlenko authored
91
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
92 Instructions for installing many of these dependencies on various platforms can be found at the Mapnik Community Wiki (http://trac.mapnik.org/wiki/MapnikInstallation).
072e35d applied patch from Dane Springmeyer
artem authored
93
9451084 touch up INSTALL doc
dane authored
94 On Linux and Mac OS, package management systems (such as apt for debian or macports for darwin) can be used to install most or all dependencies, but source installs may be preferrable. This is particularly true for libraries that a required for the Python bindings, where source installs may be the best way to ensure that the same python version us linked to Boost, Cairo, and Mapnik.
072e35d applied patch from Dane Springmeyer
artem authored
95
9451084 touch up INSTALL doc
dane authored
96 Note: a minimum of 256MB of RAM is recommended for the build process.
beb60b1 1. added installation instructions
pavlenko authored
97
6494912 OK, final fixes to the WMS stuff, cleaned up documentation, and so on.
jdoyon authored
98
beb60b1 1. added installation instructions
pavlenko authored
99 Building
d843a0e new build system
pavlenko authored
100 --------
101
7ac14c3 Add notes about sqlite and the new 'configure' option for scons in tr…
dane authored
102 Once you've installed the required software packages, the simplest way to build Mapnik is to run SCons (The software builder) without any options::
d843a0e new build system
pavlenko authored
103
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
104 $ cd ~/src/mapnik
9451084 touch up INSTALL doc
dane authored
105 $ python scons/scons.py configure
106 $ python scons/scons.py # will build sources
d843a0e new build system
pavlenko authored
107
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
108 This should compile and link the mapnik library as well as the input plugins and the python language binding (if possible). If any mandatory dependencies are not found the build will fail, and you will need to specify custom paths to your libraries and include files.
d843a0e new build system
pavlenko authored
109
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
110 SCons accepts a variety of options to customize your build. This allows you to specify which components are compiled, where to find dependencies, where to install mapnik, and so on.
d843a0e new build system
pavlenko authored
111
040ef73 Further touchup of INSTALL formatting to make the code snippets valid…
dane authored
112 To see the list of available options, from the root of the source distribution, run::
113
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
114 $ python scons/scons.py -h
115
040ef73 Further touchup of INSTALL formatting to make the code snippets valid…
dane authored
116 For example, if you compiled your own set of Boost libraries, you might use::
d843a0e new build system
pavlenko authored
117
f75e006 update INSTALL docs noting boost 1.41 and icu 1.4 requirements
dane authored
118 $ python scons/scons.py configure BOOST_INCLUDES=/usr/local/include/ BOOST_LIBS=/usr/local/lib
9451084 touch up INSTALL doc
dane authored
119
120 Or if you installed ICU from source and you'd like to build Mapnik in Debug mode you might use::
121
122 $ python scons/scons.py configure DEBUG=True ICU_INCLUDES=/usr/local/include ICU_LIBS=/usr/local/lib
d843a0e new build system
pavlenko authored
123
9451084 touch up INSTALL doc
dane authored
124 For more details on all the options see: http://trac.mapnik.org/wiki/UsingScons
072e35d applied patch from Dane Springmeyer
artem authored
125
9451084 touch up INSTALL doc
dane authored
126 Note: the Python used to run SCons does NOT have to be the same as the one used for the python bindings.
072e35d applied patch from Dane Springmeyer
artem authored
127
d843a0e new build system
pavlenko authored
128
129 Installation
130 ------------
131
040ef73 Further touchup of INSTALL formatting to make the code snippets valid…
dane authored
132 Once the build has successfully completed, you can install the various files on your system by executing::
d843a0e new build system
pavlenko authored
133
f75e006 update INSTALL docs noting boost 1.41 and icu 1.4 requirements
dane authored
134 $ sudo python scons/scons.py install
d843a0e new build system
pavlenko authored
135
040ef73 Further touchup of INSTALL formatting to make the code snippets valid…
dane authored
136 By default, everything will be installed under the PREFIX '/usr/local' as such::
d843a0e new build system
pavlenko authored
137
9451084 touch up INSTALL doc
dane authored
138 $PREFIX/lib: libmapnik.so (.dylib on mac os)
040ef73 Further touchup of INSTALL formatting to make the code snippets valid…
dane authored
139 $PREFIX/lib/mapnik/input: input plug-ins
140 $PREFIX/include: mapnik include files
141 $PREFIX/bin: shapeindex utility
142 $PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages/mapnik: Python bindings
d843a0e new build system
pavlenko authored
143
144 If you're using the default PREFIX, you will most likely need to be root to perform the install.
145
146
072e35d applied patch from Dane Springmeyer
artem authored
147 Testing Installation
148 --------------------
beb60b1 1. added installation instructions
pavlenko authored
149
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
150 First, try importing the Mapnik python module in a python interpreter, and make sure it does so without errors::
beb60b1 1. added installation instructions
pavlenko authored
151
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
152 $ python
153 Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17)
154 [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
040ef73 Further touchup of INSTALL formatting to make the code snippets valid…
dane authored
155 Type "help", "copyright", "credits" or "license" for more information.
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
156 >>> import mapnik
157 >>>
158
159 Then, try rendering the demo map, included in the Mapnik source code::
160
161 $ cd demo/python
162 $ python rundemo.py
163
164 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.
165
166 For further tests see the `tests` folder within the Mapnik source code.
ec81d1c initial import
pavlenko authored
167
072e35d applied patch from Dane Springmeyer
artem authored
168
169 Learning Mapnik
77f2dc0 A few more minor tweaks to README and INSTALL to fit reST format
dane authored
170 ---------------
072e35d applied patch from Dane Springmeyer
artem authored
171
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
172 For Users:
f75e006 update INSTALL docs noting boost 1.41 and icu 1.4 requirements
dane authored
173 - Visit http://trac.mapnik.org/wiki/LearningMapnik for basic tutorials on making maps with Mapnik using the Python bindings.
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
174
175 For Developers:
6afaa67 Fixed tabs and irc link in INSTALL document
dane authored
176 - Visit http://trac.mapnik.org/#DevelopersCorner for resources for getting involved with Mapnik development.
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
177
178
179 Mapnik Community
180 ----------------
181
182 Mapnik has an active community of talented users and developers making amazing maps.
183
184 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.
072e35d applied patch from Dane Springmeyer
artem authored
185
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
186 You can get involved by:
187 - Subscribing to the mapnik-users list: http://lists.berlios.de/mailman/listinfo/mapnik-users
188 - Subscribing to the mapnik-developers list: http://lists.berlios.de/mailman/listinfo/mapnik-devel
6afaa67 Fixed tabs and irc link in INSTALL document
dane authored
189 - Joining the #mapnik channel on irc://irc.freenode.net/mapnik
708b09f Updated install guide for trunk, specifically noting proj as required…
dane authored
190 - Signing up as a user or contributer at http://www.ohloh.net/p/mapnik/
072e35d applied patch from Dane Springmeyer
artem authored
191
192
193 A note on projection support
194 ----------------------------
195
196 Mapnik's core C++ library and map rendering engine support on-the-fly cartographic
197 reprojections.
198
040ef73 Further touchup of INSTALL formatting to make the code snippets valid…
dane authored
199 Here is an example on how to use it::
072e35d applied patch from Dane Springmeyer
artem authored
200
2c8bf97 change python syntax of example in install doc, also fixing lacking E…
dane authored
201 >>> import mapnik
202 >>> p = mapnik.Projection('+init=epsg:27700') # British National Grid
203 >>> p.forward(mapnik.Coord(-1.125,51.75))
040ef73 Further touchup of INSTALL formatting to make the code snippets valid…
dane authored
204 Coord(460396.920899,206113.214203) # reprojected coordinate x, y pair
2c8bf97 change python syntax of example in install doc, also fixing lacking E…
dane authored
205 >>> p.forward(mapnik.Envelope(-1.125,51.75,-1.0,50.75))
040ef73 Further touchup of INSTALL formatting to make the code snippets valid…
dane authored
206 Envelope(461721.365661,94917.0749406,469024.861457,206224.090767) # reprojected extent
072e35d applied patch from Dane Springmeyer
artem authored
207
208
209 The Projection() instance provides inverse() and forward() methods. For details on the possible parameters,
210 see the PROJ.4 documentation.
Something went wrong with that request. Please try again.