source: subversion/sites/www.openstreetbrowser.org/do_all_test @ 19569

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

Also refresh those shapefiles

  • Property svn:executable set to *
File size: 3.4 KB
Line 
1#!/bin/bash
2
3# This script is used to generate a test rendering
4# Only a single database is used
5
6killall generate_tiles.py
7sleep 1
8
9export ROOT_PATH=/osm/skunkosm
10export SOFTWARE_PATH=/osm/osm/software
11export DB_NAME=skunk
12
13echo "* Delete old tiles"
14rm -r $ROOT_PATH/data/tiles/*
15
16echo "* Download new OSM-File"
17cd $ROOT_PATH/data
18wget -N http://download.geofabrik.de/osm/europe/austria.osm.bz2
19wget -N http://download.geofabrik.de/osm/europe/bulgaria.osm.bz2
20wget -N -nv http://tile.openstreetmap.org/world_boundaries-spherical.tgz
21wget -N -nv http://hypercube.telascience.org/~kleptog/processed_p.zip
22wget -N -nv http://tileserv.openstreetmap.org/shoreline_300.tar.bz2
23
24echo "* Importing to Database"
25echo "- Shapefiles"
26cd $ROOT_PATH/data
27tar xzf world_boundaries-spherical.tgz
28unzip processed_p.zip
29mv coastlines/* world_boundaries/
30rmdir coastlines
31tar xjf shoreline_300.tar.bz2 -C world_boundaries
32
33cd $SOFTWARE_PATH/osm2pgsql
34psql -d gis -c "drop database $DB_NAME"
35psql -d gis -c "create database $DB_NAME"
36psql -d $DB_NAME -c "create language plpgsql"
37psql -d $DB_NAME -f /usr/share/postgresql/8.3/contrib/_int.sql
38psql -d $DB_NAME -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql
39psql -d $DB_NAME -f /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql
40./osm2pgsql -c -s -m -d $DB_NAME $ROOT_PATH/data/austria.osm.bz2
41./osm2pgsql -a -s -m -d $DB_NAME $ROOT_PATH/data/bulgaria.osm.bz2
42
43echo "- init db for osmosis"
44psql $DB_NAME < ~/src/pgsql_simple_schema.sql
45
46cd $ROOT_PATH/data/
47~skunkosm/software/osmosis-current/bin/osmosis --read-xml ~/data/austria.osm.bz2 --write-pgsql-dump
48cd pgimport
49echo "- drop unneeded geometry"
50cut -f1-3 nodes.txt > nodes1.txt
51mv nodes1.txt nodes.txt
52echo "- load db from osmosis"
53psql $DB_NAME < ~/src/pgsql_simple_load.sql
54
55cd $ROOT_PATH/data/
56~skunkosm/software/osmosis-current/bin/osmosis --read-xml ~/data/bulgaria.osm.bz2 --write-pgsql-dump
57cd pgimport
58echo "- drop unneeded geometry"
59cut -f1-3 nodes.txt > nodes1.txt
60mv nodes1.txt nodes.txt
61echo "- load db from osmosis"
62psql $DB_NAME < ~/src/pgsql_simple_load.sql
63
64echo "* Preprocessing data"
65cd $ROOT_PATH
66for i in src/sql/*.sql ; do echo "Processing $i ..." ; psql $DB_NAME < $i ; done
67
68echo "* Update style-sheet"
69export TMPDIR="/osm/`whoami`-style/`date +%Y%m%d-%H%M`"
70mkdir -p $TMPDIR
71echo "BASE"
72echo "Layers"
73cd $ROOT_PATH/render
74./gen_rotate_img.php
75./gen_layer.php > base.mml
76cascadenik-compile.py $ROOT_PATH/render/base.mml > $ROOT_PATH/render/base.xml
77$ROOT_PATH/src/update_xml.pl $ROOT_PATH/render/base.xml
78echo "PT"
79cd $ROOT_PATH/render
80convert -background none img/src/stop_p_back.svg img/stop_p_back.png
81convert -background none img/src/stop_p_for.svg img/stop_p_for.png
82convert -background none img/src/stop_n_back.svg img/stop_n_back.png
83convert -background none img/src/stop_n_for.svg img/stop_n_for.png
84convert -background none img/src/stop.svg img/stop.png
85cascadenik-compile.py $ROOT_PATH/render/overlay_pt.mml > $ROOT_PATH/render/overlay_pt.xml
86$ROOT_PATH/src/update_xml.pl $ROOT_PATH/render/overlay_pt.xml
87./create_rotate_style
88echo "CH"
89cascadenik-compile.py $ROOT_PATH/render/overlay_ch.mml > $ROOT_PATH/render/overlay_ch.xml
90$ROOT_PATH/src/update_xml.pl $ROOT_PATH/render/overlay_ch.xml
91echo "CAR"
92cascadenik-compile.py $ROOT_PATH/render/overlay_car.mml > $ROOT_PATH/render/overlay_car.xml
93$ROOT_PATH/src/update_xml.pl $ROOT_PATH/render/overlay_car.xml
94cd $ROOT_PATH
95$ROOT_PATH/src/gen_mss_from_wiki.php
96sleep 2
97
98echo "* Starting rendering"
99cd $ROOT_PATH/render
100nice ./render_all
101
102echo "* Finished"
Note: See TracBrowser for help on using the repository browser.