added scripts

This commit is contained in:
jomu
2016-07-14 11:50:00 +02:00
parent d09c113c6f
commit b7b461214c
11 changed files with 58 additions and 0 deletions

3
scripts/addWolrdToArchive.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
cd /home/osm/tiles
awk '{print $0".png"}' /home/osm/import/world/world.lst | zip /home/osm/temp/$1.zip -@

4
scripts/appendLatest.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
osmconvert --out-statistics /home/osm/import/$1/$1-latest.osm.pbf
/home/osm/bin/osm2pgsql --append --slim --flat-nodes /home/osm/temp/flat_nodes.bin --number-processes 2 --hstore --style /home/osm/openstreetmap-carto/openstreetmap-carto.style --multi-geometry -d gis -C 2000 /home/osm/import/$1/$1-latest.osm.pbf

8
scripts/createTileArchive.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
cd /home/osm/tiles
awk '{print $0".png"}' /home/osm/import/$1/tiles_$1.lst | zip /home/osm/temp/$1.zip -@
#hile read F ; do
# filename=$F.png
# zip -r /home/osm/temp/$1.zip $filename
#one </home/osm/import/$1/tiles_$1.lst

3
scripts/forceRenderWorld.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
/home/osm/bin/renderpoly.py -b -180 -90 180 90 --style /home/osm/openstreetmap-carto/osm.xml -z 0 8 --force

2
scripts/generateTileList.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
/home/osm/bin/renderpoly.py --poly /home/osm/import/$1/$1.poly --style /home/osm/openstreetmap-carto/osm.xml -z 0 16 -x /home/osm/import/$1/tiles_$1.lst

2
scripts/generateWorldList.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
/home/osm/bin/renderpoly.py -b -180 -90 180 90 --style /home/osm/openstreetmap-carto/osm.xml -z 0 8 -x /home/osm/import/world/world.lst

2
scripts/initUpdate.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
/home/osm/bin/osmosis --rrii workingDirectory=/home/osm/import/$1

5
scripts/initialImport.sh Executable file
View File

@ -0,0 +1,5 @@
/home/osm//bin/osm2pgsql --create --slim \
--flat-nodes /home/osm/temp/flat_nodes.bin \
-C 2000 --number-processes 2 --hstore \
--style /home/osm/openstreetmap-carto/openstreetmap-carto.style --multi-geometry \
/home/osm/import/$1/$1-latest.osm.pbf

2
scripts/render.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
/home/osm/bin/renderpoly.py --style /home/osm/openstreetmap-carto/osm.xml --poly /home/osm/import/$1/$1.poly -z 0 16

3
scripts/renderWorld.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
/home/osm/bin/renderpoly.py -b -180 -90 180 90 --style /home/osm/openstreetmap-carto/osm.xml -z 0 8

24
scripts/update.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
CHANGEFILE=/home/osm/import/$1/changes.osc.gz
TILEARCHIVE=/home/osm/temp/$1.zip
echo Fetching updates
osmosis --rri workingDirectory=/home/osm/import/$1 --simplify-change --write-xml-change $CHANGEFILE
if [ -e "$CHANGEFILE" ]; then
echo Applying updates to database
osm2pgsql --append --slim --style /home/osm/openstreetmap-carto/openstreetmap-carto.style -d gis -e0-16 -o /home/osm/import/$1/expire.list -C 2000 /home/osm/import/$1/changes.osc.gz
echo Rendering outdated tiles
/home/osm/bin/renderpoly.py -l /home/osm/import/$1/expire.list --style /home/osm/openstreetmap-carto/osm.xml -z 0 16 --force
if [ -e "$TILEARCHIVE" ]; then
echo Render updated tiles
awk '{print $0".png"}' /home/osm/import/$1/expire.list | zip -u $TILEARCHIVE
fi
echo Deleting obsolete files
rm $CHANGEFILE
rm /home/osm/import/$1/expire.list
fi