Changeset 694
- Timestamp:
- 04/15/08 03:24:52 (9 months ago)
- Files:
-
- 1 modified
-
trunk/INSTALL (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/INSTALL
r641 r694 2 2 3 3 INSTALLATION INSTRUCTIONS 4 5 6 Quick Start 7 ----------- 8 9 Install needed dependencies 10 $ sudo aptitude install libboost-filesystem-dev postgresql libgdal ... 11 $ cd ~/src/mapnik 12 13 Build source code 14 $ python scons/scons.py 15 16 Install mapnik libs and python bindings 17 $ sudo python scons/scons.py install 18 19 Run python interpreter and check installation 20 $ python 21 >>> from mapnik import * 22 Traceback (most recent call last): 23 File "<stdin>", line 1, in <module> 24 ImportError: No module named mapnik 25 >>> 26 27 If you get an error ensure mapnik in is your PYTHONPATH. 28 29 If not then visit https://trac.mapnik.org/wiki/GettingStarted for a basic tutorial. 30 4 31 5 32 Prerequisites … … 18 45 - (Optional) program_options 19 46 - (Optional) python 20 47 - libicu - International Components for Unicode 21 48 - libpng 22 49 - libjpeg … … 24 51 - libz 25 52 - libfreetype2 53 - (Optional) tinyxml, spirit, or libxml2 - XML Parsing libraries 26 54 - (Optional) PostgreSQL libraries (For PostGIS support) 27 55 - (Optional) PROJ.4 (More on this below) … … 30 58 - (Optional) Python 2.4 or greater for the Python language bindings 31 59 32 All of these will normally come with any modern Linux distribution.60 Some of these will come pre-installed on modern Linux/UNIX systems, including Mac OS X. The Boost libraries are an exception, but can be installed using aptitude/apt-get on debian systems or macports/fink on OS X. 33 61 34 62 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. 63 64 An an example on Ubuntu the aptitude package manager can be used to install the latest versions of all mapnik dependencies in one fell swoop: 65 66 $ aptitude install libboost-thread-dev libboost-filesystem-dev libboost-regex-dev libboost-program-options-dev libboost-python-dev libboost-serialization-dev libpng12-dev libjpeg62-dev libtiff4-dev zlib1g-dev libfreetype6-dev libltdl3-dev libfribidi-dev debhelper libboost-iostreams-dev libcairo libcairo-dev python-cairo libcairomm-1.0-1 libcairomm-1.0-dev libicu-dev postgresql libgdal-dev postgis proj 35 67 36 68 Also, a minimum of 256MB of RAM is recommended for the build process. … … 56 88 57 89 You will get: 90 91 CXX: The C++ compiler to use (defaults to g++). 92 default: g++ 93 actual: g++ 58 94 59 95 PREFIX: The install path "prefix" … … 69 105 actual: /usr/lib 70 106 71 FREETYPE_CONFIG: The path to the freetype-config executable. ( /path/to/FREETYPE_CONFIG ) 72 default: /usr/bin/freetype-config 73 actual: /usr/bin/freetype-config 107 BOOST_TOOLKIT: Specify boost toolkit e.g. gcc41. 108 default: 109 actual: 110 111 FREETYPE_CONFIG: The path to the freetype-config executable. 112 default: freetype-config 113 actual: freetype-config 114 115 XML2_CONFIG: The path to the xml2-config executable. 116 default: xml2-config 117 actual: xml2-config 118 119 ICU_INCLUDES: Search path for ICU include files ( /path/to/ICU_INCLUDES ) 120 default: /usr/include 121 actual: /usr/include 122 123 ICU_LIBS: Search path for ICU include files ( /path/to/ICU_LIBS ) 124 default: /usr/lib 125 actual: /usr/lib 74 126 75 127 PNG_INCLUDES: Search path for libpng include files ( /path/to/PNG_INCLUDES ) … … 109 161 actual: /usr/local/include 110 162 111 PROJ_LIBS: Search path for PROJ.4 includefiles ( /path/to/PROJ_LIBS )163 PROJ_LIBS: Search path for PROJ.4 library files ( /path/to/PROJ_LIBS ) 112 164 default: /usr/local/lib 113 165 actual: /usr/local/lib 166 167 GDAL_INCLUDES: Search path for GDAL include files ( /path/to/GDAL_INCLUDES ) 168 default: /usr/include 169 actual: /usr/include 170 171 GDAL_LIBS: Search path for GDAL library files ( /path/to/GDAL_LIBS ) 172 default: /usr/lib 173 actual: /usr/lib 114 174 115 175 PYTHON: Python executable ( /path/to/PYTHON ) … … 119 179 INPUT_PLUGINS: Input drivers to include 120 180 (all|none|comma-separated list of names) 121 allowed names: postgis shape raster 181 allowed names: postgis shape raster gdal 122 182 default: all 123 actual: postgis shape raster 183 actual: postgis shape raster gdal 124 184 125 185 BINDINGS: Language bindings to build … … 129 189 actual: python 130 190 131 DEBUG: Compile a debug version of mapnik 132 default: 133 actual: 191 DEBUG: Compile a debug version of mapnik (yes|no) 192 default: False 193 actual: False 194 195 DESTDIR: The root directory to install into. Useful mainly for binary package building 196 default: / 197 actual: / 198 199 THREADING: Set threading support (multi|single) 200 default: multi 201 actual: multi 202 203 XMLPARSER: Set xml parser (tinyxml|spirit|libxml2) 204 default: tinyxml 205 actual: tinyxml 206 134 207 135 208 This help should be self-explanatory! … … 138 211 139 212 $ /path/to/python scons/scons.py BOOST_INCLUDES=/usr/local/include/boost-1_33_1 BOOST_LIBS=/usr/local/lib 213 214 Or if you installed Postgres and Gdal from source and you'd like to build mapnik in Debug mode with the ability for XML parsing, you might use: 215 216 $ /path/to/python scons/scons.py DEBUG=y PGSQL_INCLUDES=/usr/local/pgsql/include PGSQL_LIBS=/usr/local/pgsql/lib XMLPARSER=libxml2 140 217 141 218 … … 158 235 159 236 160 A note on projection support 161 ---------------------------- 162 163 Mapnik's core C++ library and map rendering engine support on-the-fly cartographic 164 reprojections. 165 166 Here is an example on how to use it: 167 168 >>> from mapnik import Projection,Coord 169 >>> p = Projection('init=epsg:27700') # British National Grid 170 >>> p.foward(Coord(-1.125,51.75)) 171 Coord(460396.904482,206113.130999) 172 >>> 173 174 The Projection() instance provides inverse() and forward() methods. For details on the possible parameters, 175 see the PROJ.4 documentation. 176 177 178 Test 179 ---- 237 Testing Installation 238 -------------------- 180 239 181 240 There currently is no easy way to test your setup, other than write some code to generate a map. 182 241 183 One simple thing you can do is try to load the Python module , and make sure it does so without errors:242 One simple thing you can do is try to load the Python module in a python interpreter, and make sure it does so without errors: 184 243 185 244 $ /path/to/python … … 190 249 >>> 191 250 251 252 Learning Mapnik 253 _______________ 254 255 Visit https://trac.mapnik.org/wiki/GettingStarted for a basic tutorial on making maps with Mapnik using the Python bindings 256 257 Try running the demo scripts in mapnik/demo/python 258 259 260 A note on projection support 261 ---------------------------- 262 263 Mapnik's core C++ library and map rendering engine support on-the-fly cartographic 264 reprojections. 265 266 Here is an example on how to use it: 267 268 >>> from mapnik import Projection, Coord 269 >>> p = Projection('+init=epsg:27700') # British National Grid 270 >>> p.forward(Coord(-1.125,51.75)) 271 Coord(460396.920899,206113.214203) # reprojected coordinate x, y pair 272 >>> p.forward(Envelope(Coord(-1.125,51.75),Coord(-1.0,50.75))) 273 Envelope(461721.365661,94917.0749406,469024.861457,206224.090767) # reprojected extent 274 275 276 The Projection() instance provides inverse() and forward() methods. For details on the possible parameters, 277 see the PROJ.4 documentation.
