forked from vightel/FloodMapsWorkshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetdata.sh
99 lines (83 loc) · 2 KB
/
getdata.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
94
95
96
97
98
99
# Get data from S3 and install in proper directories
# Store Current Directory
if [ ! $WORKSHOP_DIR ]; then
echo "Need to set your WORKSHOP_DIR env var";
exit -1;
fi
if [ ! $DBHOST ]; then
echo "Need to set your DBHOST env var";
exit -1;
fi
if [ ! $DBNAME ]; then
echo "Need to set your DBNAME env var";
exit -1;
fi
if [ ! $DBOWNER ]; then
echo "Need to set your DBOWNER env var";
exit -1;
fi
if [ ! $DBPORT ]; then
echo "Need to set your DBPORT env var";
exit -1;
fi
if [ ! $PGPASS ]; then
echo "Need to set your PGPASS env var";
exit -1;
fi
if [ ! $DATABASE_URL ]; then
echo "Need to set your DATABASE_URL env var";
exit -1;
fi
if [ ! $USGS_ACCOUNT ]; then
echo "Need to set your USGS_ACCOUNT env var";
exit -1;
fi
if [ ! $USGS_PASSWORD ]; then
echo "Need to set your USGS_PASSWORD env var";
exit -1;
fi
cd $WORKSHOP_DIR/data
if [ ! -d HydroSHEDS ]; then
mkdir HydroSHEDS
fi
if [ ! -d HAND ]; then
mkdir HAND
fi
if [ ! -d eo1_ali ]; then
mkdir eo1_ali
fi
if [ ! -d l8 ]; then
mkdir l8
fi
if [ ! -d l8/LC80090472013357LGN00 ]; then
mkdir l8/LC80090472013357LGN00
fi
if [ ! -d modis ]; then
mkdir modis
fi
if [ ! -d radarsat2 ]; then
mkdir radarsat2
fi
cd $WORKSHOP_DIR/data/HAND
if [ ! -d CA ]; then
wget "https://s3.amazonaws.com/mena_data/CA.zip"
unzip CA.zip
fi
# Install Landsat8 Data
cd $WORKSHOP_DIR/data/l8/LC80090472013357LGN00
if [ ! -f LC80090472013357LGN00.tar.gz ]; then
wget "https://s3.amazonaws.com/mena_data/LC80090472013357LGN00.tar.gz"
tar -xvf LC80090472013357LGN00.tar.gz
fi
# Install Radarsat2 data
cd $WORKSHOP_DIR/data/radarsat2
if [ ! -f RS2_OK33065_PK325251_DK290050_F6F_20120825_230857_HH_SGF.zip ]; then
wget "https://s3.amazonaws.com/mena_data/RS2_OK33065_PK325251_DK290050_F6F_20120825_230857_HH_SGF.zip"
unzip RS2_OK33065_PK325251_DK290050_F6F_20120825_230857_HH_SGF.zip
fi
# Install OSM world_boundaries
cd $WORKSHOP_DIR/python
if [ ! -d world_boundaries ]; then
wget "https://s3.amazonaws.com/mena_data/world_boundaries.zip"
unzip world_boundaries.zip
fi