forked from brunner-ste/RasterConverter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Proccessing_POL_500k_2018.sh
93 lines (69 loc) · 2.11 KB
/
Proccessing_POL_500k_2018.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/bash
# ICAO Poland 2018
NAME='icao_pol_2018'
GROUP='icao'
CATEGORY='aero'
PUBLISHED='2018-08'
ISO='pol'
RAW=''$HOME'/server/Eanserver18/raster/tmp/BR/itcom_lpr/500k/raw'
SHP=''$HOME'/server/Eanserver18/raster/tmp/BR/itcom_lpr/500k/shp'
RGBA=''$HOME'/server/Eanserver18/raster/tmp/BR/itcom_lpr/500k/tif_rgba'
ARCHIVE=''$HOME'/server/Eanserver18/raster/tmp/BR/itcom_lpr/500k/icao_'$ISO'_2018.tar.gz'
CONVERTED=''$HOME'/server/Eanserver18/raster/tmp/BR/itcom_lpr/500k/icao_'$ISO'_2018'
PACK=''$HOME'/server/Eanserver18/raster/tmp/BR/itcom_lpr/500k/icao_'$ISO'_2018/icao_'$ISO'_2018.pck*'
clear
##################################
echo ' '
date
echo Gestartet um: > log_$NAME
date >> log_$NAME
##################################
mkdir $NAME
mkdir tif_rgba
# Immer letzte Version verwenden!
CRUNCHER=''$HOME'/server/Eanserver18/raster/tmp/BR/'
PACKER='/usr/libexec'
echo ' '
date
echo 'Croppen und reproject gestartet...'
find $RAW -iname *.tif -print0 | xargs -0 -P4 -I{} bash -c 'gdalwarp -q -co TILED=YES -co COMPRESS=LZW -co PREDICTOR=2 -cutline '$SHP/*.shp' -dstalpha -r cubic -t_srs EPSG:4326 -of GTiff {} '$RGBA'/$(basename {})_rgba.tif'
cd $RGBA
gdalbuildvrt $NAME.vrt -srcnodata 0 *.tif
echo ' '
date
echo 'Konvertierung gestartet...'
echo ' '
# Mapcruncher
$CRUNCHER/mapcruncher -n $NAME -g $GROUP -c $CATEGORY -p $PUBLISHED $NAME.vrt ../$NAME.pck && date && do_refurbish-raster-map ../$NAME.pck ../$NAME/$NAME.pck && extract-map.def-zl.def ../$NAME/$NAME.pck ../$NAME
rm ../$NAME.pck*
# Tar Archiv fuer EN5 erstellen
echo ' '
date
echo ' '
echo 'EN5 Archiv erstellen...'
$PACKER/pack2tar $PACK >$ARCHIVE
date
echo ' '
echo 'MD5 Summen erstellen...'
cd ..
cd $CONVERTED
md5sum *.pck* >$NAME.md5
cd ..
mkdir en7
mv $CONVERTED en7
date
echo ' '
echo 'Konvertierung und Ablage aller Daten abgeschlossen...'
echo ' '
##################################
echo ' ' >> log_$NAME
echo Fertig um: >> log_$NAME
date >> log_$NAME
##################################
read -p "Temporaere Daten loeschen? (j/n)?" WAHL
if [[ "$WAHL" == [j,J] ]]; then
rm -r $RGBA
echo "Alles geloescht..."
else
echo "Nichts geloescht..."
fi