source: subversion/sites/www.openstreetbrowser.org/do_all_live @ 19778

Last change on this file since 19778 was 19572, checked in by skunk, 10 years ago

Get rid of 'world_boundaries', only use shoreline_300 and processed_p

  • Property svn:executable set to *
File size: 3.6 KB
Line 
1#!/bin/bash
2
3# This script is used in the live database
4# The import happens in a new database called 'gisnew'
5# When everything is finished the old database 'gis' is renamed to 'gisold' (in
6# case something went wrong, it can be drop later or when do_all_live is called
7# the next time) and 'gisnew' renamed to 'gis'
8
9export ROOT_PATH=/osm/osm
10export SOFTWARE_PATH=/osm/osm/software
11export DB_NAME=gisnew
12
13echo "=== Starting Database reload. Press key to continue."
14read
15
16echo "* SVN - Update database import"
17svn update src/
18
19echo "* Download new OSM-File"
20cd $ROOT_PATH/data
21wget -N http://download.geofabrik.de/osm/europe.osm.bz2
22wget -N -nv http://hypercube.telascience.org/~kleptog/processed_p.zip
23wget -N -nv http://tileserv.openstreetmap.org/shoreline_300.tar.bz2
24
25echo "* Importing to Database"
26echo "- Shapefiles"
27cd $ROOT_PATH/data
28mkdir world_boundaries/
29unzip processed_p.zip
30mv coastlines/* world_boundaries/
31rmdir coastlines
32tar xjf shoreline_300.tar.bz2 -C world_boundaries
33
34echo "- prepare osm2pgsql"
35cd $SOFTWARE_PATH/osm2pgsql
36psql -d gis -c "drop database gisold"
37psql -d gis -c "drop database gisnew"
38psql -d gis -c "create database gisnew"
39psql -d gisnew -c "create language plpgsql"
40psql -d gisnew -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql
41psql -d gisnew -f /usr/share/postgresql/8.3/contrib/_int.sql
42echo "= osm2pgsql"
43./osm2pgsql -c -s -m -d $DB_NAME -S $ROOT_PATH/render/osm2pgsql.style ~/data/europe.osm.bz2
44echo "= osmosis"
45echo "- init db for osmosis"
46psql $DB_NAME < ~/src/pgsql_simple_schema.sql
47cd $ROOT_PATH/data/
48~skunkosm/software/osmosis-current/bin/osmosis --read-xml ~/data/europe.osm.bz2 --write-pgsql-dump
49cd pgimport
50echo "- drop unneeded geometry"
51cut -f1-3 nodes.txt > nodes1.txt
52mv nodes1.txt nodes.txt
53echo "- load db from osmosis"
54psql $DB_NAME < ~/src/pgsql_simple_load.sql
55
56echo "finished import - next preprocess"
57# read
58
59echo "* Preprocessing data"
60cd $ROOT_PATH
61for i in src/sql/*.sql ; do echo "Executing $i ..." ; psql $DB_NAME < $i ; done
62
63echo "=== Preprocessing finsished. Press key to continue"
64read
65
66echo "* SVN - Update style"
67svn update conf.php render/
68
69export DB_NAME=gis
70
71echo "* Update style-sheet"
72export TMPDIR="/osm/`whoami`-style/`date +%Y%m%d-%H%M`"
73mkdir -p $TMPDIR
74echo "BASE"
75echo "Layers"
76cd $ROOT_PATH/render
77./gen_rotate_img.php
78./gen_layer.php > base.mml
79cascadenik-compile.py $ROOT_PATH/render/base.mml > $ROOT_PATH/render/base.xml
80$ROOT_PATH/src/update_xml.pl $ROOT_PATH/render/base.xml
81echo "PT"
82cd $ROOT_PATH/render
83convert -background none img/src/stop_p_back.svg img/stop_p_back.png
84convert -background none img/src/stop_p_for.svg img/stop_p_for.png
85convert -background none img/src/stop_n_back.svg img/stop_n_back.png
86convert -background none img/src/stop_n_for.svg img/stop_n_for.png
87convert -background none img/src/stop.svg img/stop.png
88cascadenik-compile.py $ROOT_PATH/render/overlay_pt.mml > $ROOT_PATH/render/overlay_pt.xml
89$ROOT_PATH/src/update_xml.pl $ROOT_PATH/render/overlay_pt.xml
90./create_rotate_style
91echo "CH"
92cascadenik-compile.py $ROOT_PATH/render/overlay_ch.mml > $ROOT_PATH/render/overlay_ch.xml
93$ROOT_PATH/src/update_xml.pl $ROOT_PATH/render/overlay_ch.xml
94echo "CAR"
95cascadenik-compile.py $ROOT_PATH/render/overlay_car.mml > $ROOT_PATH/render/overlay_car.xml
96$ROOT_PATH/src/update_xml.pl $ROOT_PATH/render/overlay_car.xml
97echo "WIKI Style"
98cd $ROOT_PATH
99$ROOT_PATH/src/gen_mss_from_wiki.php
100
101echo "=== Updated Style. Press key to continue"
102read
103
104echo "* SVN - Updating rest of code"
105svn update
106
107killall renderd
108
109psql -d gisnew -c "alter database gis rename to gisold"
110psql -d gisold -c "alter database gisnew rename to gis"
111touch /osm/tiles/planet-import-complete
112
113cd $ROOT_PATH
114./software/mod_tile/mod_tile/renderd
Note: See TracBrowser for help on using the repository browser.