source: subversion/applications/rendering/mapnik/install.txt @ 3104

Last change on this file since 3104 was 3104, checked in by joerg, 13 years ago

Update install.txt to reflect cuttent state a little bit more
remove propset to mapnik.org

File size: 4.0 KB
Line 
1# This is a start for an (almost) cut'n past installation description for mapnik-osm-renderer
2
3# ------ Install some stuff
4  sudo apt-get install \
5                build-essential libfreetype6-dev libltdl3-dev \
6                libpng12-dev  libtiff4-dev libboost-thread-dev\
7                libboost-filesystem-dev \
8                libboost-serialization-dev libboost-regex-dev\
9                libboost-python-dev  proj python-imaging scons \
10                libboost-program-options-dev postgresql-doc-8.1 \
11                postgresql-8.1 postgresql-8.1-plruby \
12                postgresql-client-8.1 postgresql-contrib-8.1\
13                postgresql-plperl-8.1 postgresql-plpython-8.1 \
14                postgresql-server-dev-8.1 postgresql-8.1-postgis \
15                libboost-python-dev python2.4-dev \
16                libwww-perl libxml-parser-perl libfile-slurp-perl \
17                libtimedate-perl libdate-manip-perl imagemagick \
18                libavl-dev \
19                ttf-dejavu \
20                libmapnik-dev libmapnik1d mapnik-plugins mapnik-utils \
21                python-imaging python-mapnik libxml2-dev g++-4.1 libzzip-dev libzvt-dev \
22                libwbxml2-dev lib64bz2-dev libxml-dev libxml2-dev
23
24
25# ---- get software from OSM-SVN and compile
26  cd
27  svn co http://svn.openstreetmap.org/
28
29  # compile osmsql
30  (cd ~/svn.openstreetmap.org/applications/utils/export/osm2pgsql/; make)
31
32
33# ----------- Create Database and Grant rights
34
35  export user_name=`whoami`
36  # or with a different user. 'steve' is the example user here ;-)
37  export user_name="steve"
38  sudo -u postgres createdb -Upostgres  -EUTF8 gis
39  sudo -u postgres createuser -Upostgres -S -D -R $user_name
40  echo "GRANT ALL ON SCHEMA PUBLIC TO \"$user_name\";" | sudo -u postgres psql -Upostgres gis
41  sudo -u postgres createlang plpgsql gis
42  sudo -u postgres psql -Upostgres gis </usr/share/postgresql-8.1-postgis/lwpostgis.sql \
43     2>&1 | grep -v -e 'FEHLER:  aktuelle Transaktion' \
44     -e 'ERROR:  current transaction is aborted' \
45     -e 'CREATE FUNCTION' -e OPERATOR
46
47
48  echo "GRANT ALL on geometry_columns TO \"$user_name\";" | sudo -u postgres psql -Upostgres gis
49  echo "GRANT ALL on spatial_ref_sys TO \"$user_name\";" | sudo -u postgres psql -Upostgres gis
50
51  echo "GRANT ALL ON SCHEMA PUBLIC TO \"$user_name\";" | sudo -u postgres psql -Upostgres gis
52
53 
54# ---- Install and run planet-mirror --> planet.sql
55  # Get newest planet.osm. This will takes some time
56  ~/svn.openstreetmap.org/applications/utils/planet-mirror/planet-mirror.pl -v -d
57  export planet_name=`~/svn.openstreetmap.org/applications/utils/planet-mirror/planet-mirror.pl -print-filename`
58  echo "export planet_name='$planet_name'"
59
60  # convert osm --> sql and import. takes about 45 minutes on a 2GHz (0.5GB-Ram) Machine
61  # for Writing way(663k)
62  ~/svn.openstreetmap.org/applications/utils/export/osm2pgsql/osm2pgsql/osm2pgsql $planet_name.gz
63
64
65  # Test if you can read the Database
66  echo "SELECT * from planet_osm_polygon LIMIT 2;" |  psql  gis -h /var/run/postgresql
67
68
69# From here on the cut'n paste part stops
70  cd ~/svn.openstreetmap.org/applications/rendering/mapnik/
71  vi convert
72  # then replace jburgess to your username
73
74  ./convert osm.xml > osm-local.xml
75
76  vi generate_tiles.py
77  vi osm.xml
78     and change the path to your installation:
79     /home/mapnik/
80
81  vi osm.xml
82   replace with your username:
83      <Parameter name="user">steve</Parameter>
84   replace /home/mapnik/ with your home-directory
85
86   set the host connection to your local machine:
87      <Parameter name="host">/var/run/postgresql</Parameter>
88
89   remove this for local connections:
90#      <Parameter name="port">5432</Parameter>
91
92
93vi ~/svn.openstreetmap.org/applications/rendering/mapnik/generate_tiles.py
94    replace with your area
95    bbox = (-2, 50.0,1.0,52.0)
96
97# ---------- And now, we start the rendering
98export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
99export PYTHONPATH=/usr/lib/python2.5/site-packages:/usr/share/pycentral/python-mapnik/site-packages
100python ~/svn.openstreetmap.org/applications/rendering/mapnik/generate_tiles.py
Note: See TracBrowser for help on using the repository browser.