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

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

add svn co again

File size: 4.2 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
18# ---- get software from OSM-SVN and compile
19  cd
20  svn co http://svn.openstreetmap.org/
21  # compile osmsql
22  (cd ~/svn.openstreetmap.org/applications/utils/export/osm2pgsql/; make)
23
24
25# ----------- Create Database and Grant rights
26
27  export user_name=`whoami`
28  # or with a different user. 'steve' is the example user here ;-)
29  export user_name="steve"
30  sudo -u postgres createdb -Upostgres  -EUTF8 gis
31  sudo -u postgres createuser -Upostgres -S -D -R \"$user_name\"
32  echo "GRANT ALL ON SCHEMA PUBLIC TO \"$user_name\";" | sudo -u postgres psql -Upostgres gis
33  sudo -u postgres createlang plpgsql gis
34  sudo -u postgres psql -Upostgres gis </usr/share/postgresql-8.1-postgis/lwpostgis.sql \
35     2>&1 | grep -v -e 'FEHLER:  aktuelle Transaktion' \
36     -e 'ERROR:  current transaction is aborted' \
37     -e 'CREATE FUNCTION' -e OPERATOR
38   echo "GRANT ALL on geometry_columns TO \"$user_name\";" | sudo -u postgres psql -Upostgres gis
39  echo "GRANT ALL on spatial_ref_sys TO \"$user_name\";" | sudo -u postgres psql -Upostgres gis
40  echo "GRANT ALL ON SCHEMA PUBLIC TO \"$user_name\";" | sudo -u postgres psql -Upostgres gis
41
42
43 
44 # ------- Get World Boundaries
45 # Download is (600MB)
46 # unpacking is an additional 1.2GB
47 wget http://artem.dev.openstreetmap.org/files/world_boundaries.tar.bz2 -O /tmp/world_boundaries.tar.bz2
48 mkdir -p /usr/share/mapnik
49 cd /usr/local/mapnik
50 tar -xvjf /tmp/world_boundaries.tar.bz2
51 
52# ---- Install and run planet-mirror --> planet.sql
53  # Get newest planet.osm. This will takes some time
54  ~/svn.openstreetmap.org/applications/utils/planet-mirror/planet-mirror.pl -v -d
55  export planet_name=`~/svn.openstreetmap.org/applications/utils/planet-mirror/planet-mirror.pl -print-filename`
56  echo "export planet_name='$planet_name'"
57
58#  ~/svn.openstreetmap.org/applications/utils/export/osm2pgsql/osm2pgsql $planet_name.gz
59
60  ~/svn.openstreetmap.org/applications/utils/export/osm2pgsql/osm2pgsql ~/osm/planet/planet-*.osm
61
62  # convert osm --> sql and import. takes about 45 minutes on a 2GHz (0.5GB-Ram) Machine
63  #                                             23 minutes on a 3GHz (2 GB-Ram) Machine
64  # Processing: Node(11420k)
65  # Processing: Segment(12080k)
66  # Processing: Way(726k)
67  # for Writing way(663k)
68
69
70  # Test if you can read the Database
71  echo "SELECT * from planet_osm_polygon LIMIT 2;" |  psql  gis -h /var/run/postgresql
72
73
74# From here on the cut'n paste part stops
75  cd ~/svn.openstreetmap.org/applications/rendering/mapnik/
76  vi convert
77  # then replace jburgess to your username
78
79  ./convert osm.xml > osm-local.xml
80
81  vi generate_tiles.py
82  vi osm.xml
83     and change the path to your installation:
84     /home/mapnik/
85
86  vi osm.xml
87   replace with your username:
88      <Parameter name="user">steve</Parameter>
89   replace /home/mapnik/ with your home-directory
90
91   set the host connection to your local machine:
92      <Parameter name="host">/var/run/postgresql</Parameter>
93
94   remove this for local connections:
95#      <Parameter name="port">5432</Parameter>
96
97
98vi ~/svn.openstreetmap.org/applications/rendering/mapnik/generate_tiles.py
99    replace with your area
100    bbox = (-2, 50.0,1.0,52.0)
101
102   mkdir -p ~/osm/tiles
103
104# ---------- And now, we start the rendering
105export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
106export PYTHONPATH=/usr/lib/python2.5/site-packages:/usr/share/pycentral/python-mapnik/site-packages
107python ~/svn.openstreetmap.org/applications/rendering/mapnik/generate_tiles.py
Note: See TracBrowser for help on using the repository browser.