Changeset 694

Show
Ignore:
Timestamp:
04/15/08 03:24:52 (7 months ago)
Author:
artem
Message:

applied patch from Dane Springmeyer

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/INSTALL

    r641 r694  
    22 
    33INSTALLATION INSTRUCTIONS 
     4 
     5 
     6Quick Start 
     7----------- 
     8 
     9Install needed dependencies 
     10$ sudo aptitude install libboost-filesystem-dev postgresql libgdal ... 
     11$ cd ~/src/mapnik 
     12 
     13Build source code 
     14$ python scons/scons.py  
     15 
     16Install mapnik libs and python bindings 
     17$ sudo python scons/scons.py install 
     18 
     19Run python interpreter and check installation 
     20$ python 
     21>>> from mapnik import * 
     22Traceback (most recent call last): 
     23  File "<stdin>", line 1, in <module> 
     24ImportError: No module named mapnik 
     25>>> 
     26 
     27If you get an error ensure mapnik in is your PYTHONPATH. 
     28 
     29If not then visit https://trac.mapnik.org/wiki/GettingStarted for a basic tutorial. 
     30 
    431 
    532Prerequisites 
     
    1845        - (Optional) program_options 
    1946        - (Optional) python 
    20  
     47- libicu - International Components for Unicode 
    2148- libpng 
    2249- libjpeg 
     
    2451- libz 
    2552- libfreetype2 
     53- (Optional) tinyxml, spirit, or libxml2 - XML Parsing libraries  
    2654- (Optional) PostgreSQL libraries (For PostGIS support) 
    2755- (Optional) PROJ.4 (More on this below) 
     
    3058- (Optional) Python 2.4 or greater for the Python language bindings 
    3159 
    32 All of these will normally come with any modern Linux distribution. 
     60Some 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. 
    3361 
    3462If 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 
     64An 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 
    3567 
    3668Also, a minimum of 256MB of RAM is recommended for the build process. 
     
    5688 
    5789You will get: 
     90 
     91CXX: The C++ compiler to use (defaults to g++). 
     92    default: g++ 
     93    actual: g++ 
    5894 
    5995PREFIX: The install path "prefix" 
     
    69105    actual: /usr/lib 
    70106 
    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 
     107BOOST_TOOLKIT: Specify boost toolkit e.g. gcc41. 
     108    default:  
     109    actual:  
     110 
     111FREETYPE_CONFIG: The path to the freetype-config executable. 
     112    default: freetype-config 
     113    actual: freetype-config 
     114 
     115XML2_CONFIG: The path to the xml2-config executable. 
     116    default: xml2-config 
     117    actual: xml2-config 
     118 
     119ICU_INCLUDES: Search path for ICU include files ( /path/to/ICU_INCLUDES ) 
     120    default: /usr/include 
     121    actual: /usr/include 
     122 
     123ICU_LIBS: Search path for ICU include files ( /path/to/ICU_LIBS ) 
     124    default: /usr/lib 
     125    actual: /usr/lib 
    74126 
    75127PNG_INCLUDES: Search path for libpng include files ( /path/to/PNG_INCLUDES ) 
     
    109161    actual: /usr/local/include 
    110162 
    111 PROJ_LIBS: Search path for PROJ.4 include files ( /path/to/PROJ_LIBS ) 
     163PROJ_LIBS: Search path for PROJ.4 library files ( /path/to/PROJ_LIBS ) 
    112164    default: /usr/local/lib 
    113165    actual: /usr/local/lib 
     166 
     167GDAL_INCLUDES: Search path for GDAL include files ( /path/to/GDAL_INCLUDES ) 
     168    default: /usr/include 
     169    actual: /usr/include 
     170 
     171GDAL_LIBS: Search path for GDAL library files ( /path/to/GDAL_LIBS ) 
     172    default: /usr/lib 
     173    actual: /usr/lib 
    114174 
    115175PYTHON: Python executable ( /path/to/PYTHON ) 
     
    119179INPUT_PLUGINS: Input drivers to include 
    120180    (all|none|comma-separated list of names) 
    121     allowed names: postgis shape raster 
     181    allowed names: postgis shape raster gdal 
    122182    default: all 
    123     actual: postgis shape raster 
     183    actual: postgis shape raster gdal 
    124184 
    125185BINDINGS: Language bindings to build 
     
    129189    actual: python 
    130190 
    131 DEBUG: Compile a debug version of mapnik 
    132     default: 
    133     actual: 
     191DEBUG: Compile a debug version of mapnik (yes|no) 
     192    default: False 
     193    actual: False 
     194 
     195DESTDIR: The root directory to install into. Useful mainly for binary package building 
     196    default: / 
     197    actual: / 
     198 
     199THREADING: Set threading support (multi|single) 
     200    default: multi 
     201    actual: multi 
     202 
     203XMLPARSER: Set xml parser  (tinyxml|spirit|libxml2) 
     204    default: tinyxml 
     205    actual: tinyxml 
     206 
    134207 
    135208This help should be self-explanatory! 
     
    138211 
    139212$ /path/to/python scons/scons.py BOOST_INCLUDES=/usr/local/include/boost-1_33_1 BOOST_LIBS=/usr/local/lib 
     213 
     214Or 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 
    140217 
    141218 
     
    158235 
    159236 
    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 ---- 
     237Testing Installation 
     238-------------------- 
    180239 
    181240There currently is no easy way to test your setup, other than write some code to generate a map. 
    182241 
    183 One simple thing you can do is try to load the Python module, and make sure it does so without errors: 
     242One simple thing you can do is try to load the Python module in a python interpreter, and make sure it does so without errors: 
    184243 
    185244$ /path/to/python 
     
    190249>>> 
    191250 
     251 
     252Learning Mapnik 
     253_______________ 
     254 
     255Visit https://trac.mapnik.org/wiki/GettingStarted for a basic tutorial on making maps with Mapnik using the Python bindings 
     256 
     257Try running the demo scripts in mapnik/demo/python 
     258 
     259 
     260A note on projection support 
     261---------------------------- 
     262 
     263Mapnik's core C++ library and map rendering engine support on-the-fly cartographic 
     264reprojections. 
     265 
     266Here 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)) 
     271Coord(460396.920899,206113.214203) # reprojected coordinate x, y pair 
     272>>> p.forward(Envelope(Coord(-1.125,51.75),Coord(-1.0,50.75))) 
     273Envelope(461721.365661,94917.0749406,469024.861457,206224.090767) # reprojected extent 
     274 
     275 
     276The Projection() instance provides inverse() and forward() methods.  For details on the possible parameters, 
     277see the PROJ.4 documentation.