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

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

Generate style for overlay Agriculture & Industry

  • Property svn:executable set to *
File size: 4.1 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://hypercube.telascience.org/~kleptog/processed_p.zip
21wget -N -nv http://tileserv.openstreetmap.org/shoreline_300.tar.bz2
22
23echo "* Importing to Database"
24echo "- Shapefiles"
25cd $ROOT_PATH/data
26mkdir world_boundaries/
27unzip processed_p.zip
28mv coastlines/* world_boundaries/
29rmdir coastlines
30tar xjf shoreline_300.tar.bz2 -C world_boundaries
31
32cd $SOFTWARE_PATH/osm2pgsql
33psql -d gis -c "drop database $DB_NAME"
34psql -d gis -c "create database $DB_NAME"
35psql -d $DB_NAME -c "create language plpgsql"
36psql -d $DB_NAME -f /usr/share/postgresql/8.3/contrib/_int.sql
37psql -d $DB_NAME -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql
38psql -d $DB_NAME -f /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql
39./osm2pgsql -c -s -m -d $DB_NAME -S $ROOT_PATH/render/osm2pgsql.style $ROOT_PATH/data/austria.osm.bz2
40./osm2pgsql -a -s -m -d $DB_NAME -S $ROOT_PATH/render/osm2pgsql.style $ROOT_PATH/data/bulgaria.osm.bz2
41
42echo "- init db for osmosis"
43psql $DB_NAME < ~/src/pgsql_simple_schema.sql
44
45cd $ROOT_PATH/data/
46~skunkosm/software/osmosis-current/bin/osmosis --read-xml ~/data/austria.osm.bz2 --write-pgsql-dump
47cd pgimport
48echo "- drop unneeded geometry"
49cut -f1-3 nodes.txt > nodes1.txt
50mv nodes1.txt nodes.txt
51echo "- load db from osmosis"
52psql $DB_NAME < ~/src/pgsql_simple_load.sql
53
54cd $ROOT_PATH/data/
55~skunkosm/software/osmosis-current/bin/osmosis --read-xml ~/data/bulgaria.osm.bz2 --write-pgsql-dump
56cd pgimport
57echo "- drop unneeded geometry"
58cut -f1-3 nodes.txt > nodes1.txt
59mv nodes1.txt nodes.txt
60echo "- load db from osmosis"
61psql $DB_NAME < ~/src/pgsql_simple_load.sql
62
63echo "* Preprocessing data"
64cd $ROOT_PATH
65for i in src/sql/*.sql ; do echo "Processing $i ..." ; psql $DB_NAME < $i ; done
66
67echo "List"
68php $ROOT_PATH/src/wiki_data_conf.php
69php src/wiki_create_indexes.php | psql $DB_NAME
70
71echo "* Update style-sheet"
72export TMPDIR="/osm/`whoami`-style/`date +%Y%m%d-%H%M`"
73mkdir -p $TMPDIR
74echo "WIKI Style"
75cd $ROOT_PATH
76$ROOT_PATH/src/gen_mss_from_wiki.php
77echo "BASE"
78echo "Layers"
79cd $ROOT_PATH/render
80./gen_rotate_img.php
81./gen_layer.php > base.mml
82cascadenik-compile.py $ROOT_PATH/render/base.mml > $ROOT_PATH/render/base.xml
83$ROOT_PATH/src/update_xml $ROOT_PATH/render/base.xml
84echo "PT"
85cd $ROOT_PATH/render/img/rotate/src
86for i in *.svg ; do convert -background none $i ../`echo $i | sed "s/svg$/png/"` ; done
87cd $ROOT_PATH/render
88cascadenik-compile.py $ROOT_PATH/render/overlay_pt.mml > $ROOT_PATH/render/overlay_pt.xml
89$ROOT_PATH/src/update_xml $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 $ROOT_PATH/render/overlay_ch.xml
94echo "CAR"
95render/gen_mml.php $ROOT_PATH/render/overlay_car > $ROOT_PATH/render/overlay_car_compiled.mml
96cascadenik-compile.py $ROOT_PATH/render/overlay_car_compiled.mml > $ROOT_PATH/render/overlay_car.xml
97$ROOT_PATH/src/update_xml $ROOT_PATH/render/overlay_car.xml
98
99cd $ROOT_PATH
100echo "Other"
101cp $ROOT_PATH/render/overlay_services.template $ROOT_PATH/render/overlay_services.xml
102$ROOT_PATH/src/update_xml $ROOT_PATH/render/overlay_services.xml
103
104cp $ROOT_PATH/render/overlay_culture.template $ROOT_PATH/render/overlay_culture.xml
105$ROOT_PATH/src/update_xml $ROOT_PATH/render/overlay_culture.xml
106
107cp $ROOT_PATH/render/overlay_food.template $ROOT_PATH/render/overlay_food.xml
108$ROOT_PATH/src/update_xml $ROOT_PATH/render/overlay_food.xml
109
110cp $ROOT_PATH/render/shop.template $ROOT_PATH/render/shop.xml
111$ROOT_PATH/src/update_xml $ROOT_PATH/render/shop.xml
112
113cp $ROOT_PATH/render/agri_ind.template $ROOT_PATH/render/agri_ind.xml
114$ROOT_PATH/src/update_xml $ROOT_PATH/render/agri_ind.xml
115sleep 2
116
117echo "* Starting rendering"
118cd $ROOT_PATH/render
119nice ./render_all
120
121echo "* Finished"
Note: See TracBrowser for help on using the repository browser.