File: INSTALL

package info (click to toggle)
mapnik 0.5.1-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 19,136 kB
  • ctags: 14,550
  • sloc: cpp: 68,887; python: 24,895; xml: 1,534; makefile: 503; sh: 79
file content (191 lines) | stat: -rw-r--r-- 5,971 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# $Id: INSTALL 641 2008-02-07 10:01:48Z artem $

INSTALLATION INSTRUCTIONS

Prerequisites
-------------

First, here is a quick list of the software dependencies:

- Linux/UNIX with g++ compiler

- libboost 1.33.0 or greater with the following libraries included:
	- thread
        - system (boost >= 1.35 only)
	- filesystem
	- regex
        - iostreams
	- (Optional) program_options
	- (Optional) python

- libpng
- libjpeg
- libtiff
- libz
- libfreetype2
- (Optional) PostgreSQL libraries (For PostGIS support)
- (Optional) PROJ.4 (More on this below)
- (Optional) GDAL 
- Python 1.5.2 or greater to build Mapnik
- (Optional) Python 2.4 or greater for the Python language bindings

All of these will normally come with any modern Linux distribution.

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.  Instructions on how to do this will come with each individual package.

Also, a minimum of 256MB of RAM is recommended for the build process.


Building
--------

Once you've installed the required software packages, the simplest way to build mapnik is to run "scons" (The software builder) without any options:

$ cd /path/to/mapnik-sourcecode
$ /path/to/python scons/scons.py

This should compile and link the mapnik library, 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 (see below).

Note that the python used to run "scons" does NOT have to be the same as the one used for the python bindings.

"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.

To see the list of available options, from the root of the source distribution, run:

$ /path/to/python scons/scons.py -h

You will get:

PREFIX: The install path "prefix"
    default: /usr/local
    actual: /usr/local

BOOST_INCLUDES: Search path for boost include files ( /path/to/BOOST_INCLUDES )
    default: /usr/include
    actual: /usr/include

BOOST_LIBS: Search path for boost library files ( /path/to/BOOST_LIBS )
    default: /usr/lib
    actual: /usr/lib

FREETYPE_CONFIG: The path to the freetype-config executable. ( /path/to/FREETYPE_CONFIG )
    default: /usr/bin/freetype-config
    actual: /usr/bin/freetype-config

PNG_INCLUDES: Search path for libpng include files ( /path/to/PNG_INCLUDES )
    default: /usr/include
    actual: /usr/include

PNG_LIBS: Search path for libpng include files ( /path/to/PNG_LIBS )
    default: /usr/lib
    actual: /usr/lib

JPEG_INCLUDES: Search path for libjpeg include files ( /path/to/JPEG_INCLUDES )
    default: /usr/include
    actual: /usr/include

JPEG_LIBS: Search path for libjpeg library files ( /path/to/JPEG_LIBS )
    default: /usr/lib
    actual: /usr/lib

TIFF_INCLUDES: Search path for libtiff include files ( /path/to/TIFF_INCLUDES )
    default: /usr/include
    actual: /usr/include

TIFF_LIBS: Search path for libtiff library files ( /path/to/TIFF_LIBS )
    default: /usr/lib
    actual: /usr/lib

PGSQL_INCLUDES: Search path for PostgreSQL include files ( /path/to/PGSQL_INCLUDES )
    default: /usr/include
    actual: /usr/include

PGSQL_LIBS: Search path for PostgreSQL library files ( /path/to/PGSQL_LIBS )
    default: /usr/lib
    actual: /usr/lib

PROJ_INCLUDES: Search path for PROJ.4 include files ( /path/to/PROJ_INCLUDES )
    default: /usr/local/include
    actual: /usr/local/include

PROJ_LIBS: Search path for PROJ.4 include files ( /path/to/PROJ_LIBS )
    default: /usr/local/lib
    actual: /usr/local/lib

PYTHON: Python executable ( /path/to/PYTHON )
    default: /usr/bin/python
    actual: /usr/bin/python

INPUT_PLUGINS: Input drivers to include
    (all|none|comma-separated list of names)
    allowed names: postgis shape raster
    default: all
    actual: postgis shape raster

BINDINGS: Language bindings to build
    (all|none|comma-separated list of names)
    allowed names: python
    default: all
    actual: python

DEBUG: Compile a debug version of mapnik
    default:
    actual:

This help should be self-explanatory!

For example, if you compiled your own set of Boost libraries, you might use:

$ /path/to/python scons/scons.py BOOST_INCLUDES=/usr/local/include/boost-1_33_1 BOOST_LIBS=/usr/local/lib


Installation
------------

Once the build has successfully completed, you can install the various files on your system by executing:

$ /path/to/python scons/scons.py install

By default, everything will be installed under the PREFIX '/usr/local' as such:

$PREFIX/lib: libmapnik.so
$PREFIX/lib/mapnik/input: input plug-ins
$PREFIX/include: mapnik include files
$PREFIX/bin: shapeindex utility
$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages/mapnik: Python bindings

If you're using the default PREFIX, you will most likely need to be root to perform the install.


A note on projection support
----------------------------

Mapnik's core C++ library and map rendering engine support on-the-fly cartographic
reprojections.

Here is an example on how to use it:

>>> from mapnik import Projection,Coord
>>> p = Projection('init=epsg:27700') # British National Grid
>>> p.foward(Coord(-1.125,51.75))
Coord(460396.904482,206113.130999)
>>>

The Projection() instance provides inverse() and forward() methods.  For details on the possible parameters,
see the PROJ.4 documentation.


Test
----

There currently is no easy way to test your setup, other than write some code to generate a map.

One simple thing you can do is try to load the Python module, and make sure it does so without errors:

$ /path/to/python
Python 2.4.2 (#1, Jan 11 2006, 10:59:28)
[GCC 3.4.4 20050721 (Red Hat 3.4.4-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from mapnik import *
>>>