annotate flys-backend/contrib/import_river.sh @ 5167:a0abb6787ab1

Add first version of import_river script
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 04 Mar 2013 12:45:52 +0100
parents
children 650f94ec3122
rev   line source
5167
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
1 #!/bin/bash
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
2 # Import script for rivers
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
3 #
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
4 # Authors:
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
5 # Andre Heinecke <aheinecke@intevation.de>
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
6 #
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
7 # Copyright:
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
8 # Copyright (C) 2012 Greenbone Networks GmbH
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
9 #
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
10 # This program is free software; you can redistribute it and/or
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
11 # modify it under the terms of the GNU General Public License
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
12 # as published by the Free Software Foundation; either version 2
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
13 # of the License, or (at your option) any later version.
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
14 #
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
15 # This program is distributed in the hope that it will be useful,
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
18 # GNU General Public License for more details.
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
19 #
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
20 # You should have received a copy of the GNU General Public License
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
21 # along with this program; if not, write to the Free Software
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
22 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
23
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
24 set -e
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
25
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
26 # Default settings
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
27 DEFAULT_HOST=localhost
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
28 DEFAULT_PORT=1521
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
29 DEFAULT_USER=flys_dami
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
30 DEFAULT_PASS=flys_dami
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
31 DEFAULT_LOG=$PWD/logs
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
32 DEFAULT_BACKEND_NAME="XE"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
33 JAR="hydr_morph/importer.jar"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
34 IMPORTER_DRY_RUN=false
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
35 IMPORTER_MAINVALUE_TYPES=QWTD
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
36 IMPORTER_ANNOTATION_TYPES="conf/annotation-types.xml"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
37
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
38
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
39 MIN_MEMORY="8024m"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
40
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
41 OPTIONAL_LIBS="${DIR}"/../opt
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
42 if [ -d "$OPTIONAL_LIBS" ]; then
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
43 export PATH="$OPTIONAL_LIBS/bin:$PATH"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
44 export LD_LIBRARY_PATH="$OPTIONAL_LIBS/lib:$LD_LIBRARY_PATH"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
45 export LD_LIBRARY_PATH="$OPTIONAL_LIBS/lib64:$LD_LIBRARY_PATH"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
46 export PYTHONPATH="$OPTIONAL_LIBS/lib/python2.6/site-packages:$PYTHONPATH"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
47 export PYTHONPATH="$OPTIONAL_LIBS/lib64/python2.6/site-packages:$PYTHONPATH"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
48 export GDAL_DATA="$OPTIONAL_LIBS/share/gdal"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
49 fi
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
50
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
51 usage(){
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
52 cat << EOF
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
53
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
54 usage: $0 [options] gew_file
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
55
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
56 Import a river described by the gew_file
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
57
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
58 OPTIONS:
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
59 -?, --help Show this message
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
60 -u, --username=<username> Database username. Default: $DEFAULT_USER
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
61 -w, --password=<password> Database password. Default: $DEFAULT_PASS
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
62 -h, --host=<host> Connect to database on host <host>.
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
63 Default: $DEFAULT_HOST
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
64 -p, --port=<number> Use port number <number>. Default: $DEFAULT_PORT
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
65 -d, --db-name=<database_name> Name of the database / backend. Default: $DEFAULT_BACKEND_NAME
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
66 -l, --log-dir=<directory> Directory in which to create the log files.
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
67 Default: $LOG_DIR
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
68 --postgres Database is PostgreSQL
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
69 --skip-hydro Skip import of hydrological data
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
70 --skip-morpho Skip import of morphological data
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
71 --skip-geo Skip import of geographic data
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
72 --skip-wst Skip import of wst data
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
73 EOF
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
74 exit 0
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
75 }
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
76
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
77 OPTS=`getopt -o ?u:w:h:p:d: \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
78 -l help,username:,password:,host:,port:,db-name:,skip-hydro,skip-morpho,skip-geo,skip-wst \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
79 -n $0 -- "$@"`
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
80 if [ $? != 0 ] ; then usage; fi
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
81 eval set -- "$OPTS"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
82 while true ; do
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
83 case "$1" in
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
84 "-?"|"--help")
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
85 usage;;
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
86 "--")
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
87 shift
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
88 break;;
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
89 "-u"|"--username")
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
90 USER=$2
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
91 shift 2;;
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
92 "-w"|"--password")
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
93 PASS=$2
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
94 shift 2;;
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
95 "-h"|"--host")
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
96 HOST=$2
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
97 shift 2;;
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
98 "-p"|"--port")
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
99 PORT=$2
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
100 shift 2;;
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
101 "-l"|"--log-dir")
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
102 LOG=$2
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
103 shift 2;;
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
104 "-d"|"--db-name")
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
105 BACKEND_NAME=$2
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
106 shift 2;;
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
107 "--skip-hydro")
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
108 SKIP_HYDRO="TRUE"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
109 shift;;
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
110 "--skip-morpho")
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
111 SKIP_MORPHO="TRUE"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
112 shift;;
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
113 "--skip-wst")
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
114 SKIP_WST="TRUE"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
115 shift;;
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
116 "--skip-geo")
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
117 SKIP_GEO="TRUE"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
118 shift;;
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
119 "--postgres")
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
120 POSTGRES="TRUE"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
121 shift;;
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
122 *)
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
123 echo "Unknown Option $1"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
124 usage;;
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
125 esac
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
126 done
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
127
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
128 if [ -z $USER ]; then
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
129 USER=$DEFAULT_USER
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
130 fi
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
131 if [ -z $PASS ]; then
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
132 PASS=$DEFAULT_PASS
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
133 fi
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
134 if [ -z $PORT ]; then
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
135 PORT=$DEFAULT_PORT
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
136 fi
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
137 if [ -z $HOST ]; then
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
138 HOST=$DEFAULT_HOST
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
139 fi
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
140 if [ -z $BACKEND_NAME ]; then
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
141 BACKEND_NAME=$DEFAULT_BACKEND_NAME
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
142 fi
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
143 if [ -z $LOGDIR ]; then
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
144 LOG=$DEFAULT_LOG
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
145 fi
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
146
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
147 if [ $# != 1 ]; then
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
148 usage
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
149 fi
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
150
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
151 if [ ! -r $1 ]; then
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
152 echo "Could not open $1 please ensure it exists and is readable"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
153 fi
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
154
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
155 GEW_FILE="$1"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
156 RIVER_NAME=$(grep "Gew.sser" "$1" | awk '{print $2}')
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
157 DATE=$(date +%Y.%m.%d_%H%M)
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
158 LOG_DIR=${LOG}/${RIVER_NAME}-$DATE
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
159 mkdir -p ${LOG_DIR}
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
160
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
161 if [ "POSTGRES" = "TRUE" ]; then
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
162 JAR=$(echo "$JAR" | sed 's/importer/importer_psql/')
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
163 if [ ! -r "$JAR" ]; then
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
164 echo "Could not find Postgres importer $JAR"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
165 exit 1
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
166 fi
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
167 OGR_CONNECTION="PG:dbname=$BACKEND_NAME host=$HOST port=$PORT \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
168 user=$USER password=$PASS"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
169 BACKEND_DB_PREFIX="jdbc:postgresql:"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
170 BACKEND_DB_DRIVER="org.postgresql.Driver"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
171 BACKEND_DB_DIALECT="org.hibernate.dialect.PostgreSQLDialect"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
172 else
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
173 BACKEND_DB_PREFIX="jdbc:oracle:thin:@"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
174 BACKEND_DB_DRIVER="oracle.jdbc.OracleDriver"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
175 BACKEND_DB_DIALECT="org.hibernate.dialect.OracleDialect"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
176 fi
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
177
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
178 BACKEND_URL=$BACKEND_DB_PREFIX//$HOST:$PORT/$BACKEND_NAME
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
179
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
180 echo "Importing $RIVER_NAME into $BACKEND_URL."
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
181
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
182 import_hydro(){
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
183 LOG_FILE=${LOG_DIR}/hydro.log
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
184 echo Importing Hydrological data.
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
185 echo Logging into: $LOG_FILE
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
186 sed 's!./import.log!'"$LOG_FILE"'!' conf/log4j.properties > $LOG_DIR/log4j.properties
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
187 java -jar \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
188 -Xmx$MIN_MEMORY \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
189 -server \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
190 -Dlog4j.configuration=file://$LOG_DIR/log4j.properties \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
191 -Dflys.backend.user=$USER \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
192 -Dflys.backend.password=$PASS \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
193 -Dflys.backend.url=$BACKEND_URL \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
194 -Dflys.backend.driver=$BACKEND_DB_DRIVER \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
195 -Dflys.backend.dialect=$BACKEND_DB_DIALECT \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
196 -Dflys.backend.importer.infogew.file="$GEW_FILE" \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
197 -Dflys.backend.main.value.types=$IMPORTER_MAINVALUE_TYPES \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
198 -Dflys.backend.importer.annotation.types=$IMPORTER_ANNOTATION_TYPES \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
199 -Dflys.backend.importer.dry.run=$IMPORTER_DRY_RUN \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
200 -Dflys.backend.importer.skip.annotations=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
201 -Dflys.backend.importer.skip.bwastr=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
202 -Dflys.backend.importer.skip.da50s=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
203 -Dflys.backend.importer.skip.da66s=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
204 -Dflys.backend.importer.skip.extra.wsts=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
205 -Dflys.backend.importer.skip.fixations=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
206 -Dflys.backend.importer.skip.flood.water=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
207 -Dflys.backend.importer.skip.flood.protection=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
208 -Dflys.backend.importer.skip.gauges=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
209 -Dflys.backend.importer.skip.historical.discharge.tables=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
210 -Dflys.backend.importer.skip.hyks=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
211 -Dflys.backend.importer.skip.official.lines=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
212 -Dflys.backend.importer.skip.prfs=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
213 -Dflys.backend.importer.skip.w80s=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
214 -Dflys.backend.importer.skip.wst=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
215 -Dflys.backend.importer.skip.waterlevel.differences=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
216 -Dflys.backend.importer.skip.waterlevels=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
217 -Dflys.backend.importer.skip.sq.relation=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
218 -Dflys.backend.importer.skip.sediment.density=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
219 -Dflys.backend.importer.skip.sediment.yield=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
220 -Dflys.backend.importer.skip.morphological.width=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
221 -Dflys.backend.importer.skip.flow.velocity=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
222 -Dflys.backend.importer.skip.bed.height.single=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
223 -Dflys.backend.importer.skip.bed.height.epoch=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
224 $JAR
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
225 }
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
226
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
227 import_morpho(){
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
228 LOG_FILE=${LOG_DIR}/morpho.log
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
229 echo Importing Morphological data.
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
230 echo Logging into: $LOG_FILE
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
231 sed 's!./import.log!'"$LOG_FILE"'!' conf/log4j.properties > $LOG_DIR/log4j.properties
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
232 java -jar \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
233 -Xmx$MIN_MEMORY \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
234 -server \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
235 -Dlog4j.configuration=file://$LOG_DIR/log4j.properties \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
236 -Dflys.backend.user=$USER \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
237 -Dflys.backend.password=$PASS \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
238 -Dflys.backend.url=$BACKEND_URL \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
239 -Dflys.backend.driver=$BACKEND_DB_DRIVER \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
240 -Dflys.backend.dialect=$BACKEND_DB_DIALECT \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
241 -Dflys.backend.importer.infogew.file="$GEW_FILE" \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
242 -Dflys.backend.main.value.types=$IMPORTER_MAINVALUE_TYPES \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
243 -Dflys.backend.importer.annotation.types=$IMPORTER_ANNOTATION_TYPES \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
244 -Dflys.backend.importer.dry.run=$IMPORTER_DRY_RUN \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
245 -Dflys.backend.importer.skip.annotations=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
246 -Dflys.backend.importer.skip.bwastr=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
247 -Dflys.backend.importer.skip.da50s=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
248 -Dflys.backend.importer.skip.da66s=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
249 -Dflys.backend.importer.skip.extra.wsts=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
250 -Dflys.backend.importer.skip.fixations=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
251 -Dflys.backend.importer.skip.flood.water=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
252 -Dflys.backend.importer.skip.flood.protection=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
253 -Dflys.backend.importer.skip.gauges=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
254 -Dflys.backend.importer.skip.historical.discharge.tables=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
255 -Dflys.backend.importer.skip.hyks=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
256 -Dflys.backend.importer.skip.official.lines=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
257 -Dflys.backend.importer.skip.prfs=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
258 -Dflys.backend.importer.skip.w80s=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
259 -Dflys.backend.importer.skip.wst=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
260 -Dflys.backend.importer.skip.waterlevel.differences=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
261 -Dflys.backend.importer.skip.waterlevels=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
262 -Dflys.backend.importer.skip.sq.relation=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
263 -Dflys.backend.importer.skip.sediment.density=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
264 -Dflys.backend.importer.skip.sediment.yield=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
265 -Dflys.backend.importer.skip.morphological.width=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
266 -Dflys.backend.importer.skip.flow.velocity=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
267 -Dflys.backend.importer.skip.bed.height.single=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
268 -Dflys.backend.importer.skip.bed.height.epoch=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
269 $JAR
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
270 }
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
271
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
272 import_wst(){
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
273 LOG_FILE=${LOG_DIR}/wst.log
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
274 echo Importing WST data.
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
275 echo Logging into: $LOG_FILE
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
276 sed 's!./import.log!'"$LOG_FILE"'!' conf/log4j.properties > $LOG_DIR/log4j.properties
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
277 java -jar \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
278 -Xmx$MIN_MEMORY \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
279 -server \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
280 -Dlog4j.configuration=file://$LOG_DIR/log4j.properties \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
281 -Dflys.backend.user=$USER \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
282 -Dflys.backend.password=$PASS \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
283 -Dflys.backend.url=$BACKEND_URL \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
284 -Dflys.backend.driver=$BACKEND_DB_DRIVER \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
285 -Dflys.backend.dialect=$BACKEND_DB_DIALECT \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
286 -Dflys.backend.importer.infogew.file="$GEW_FILE" \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
287 -Dflys.backend.main.value.types=$IMPORTER_MAINVALUE_TYPES \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
288 -Dflys.backend.importer.annotation.types=$IMPORTER_ANNOTATION_TYPES \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
289 -Dflys.backend.importer.dry.run=$IMPORTER_DRY_RUN \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
290 -Dflys.backend.importer.skip.annotations=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
291 -Dflys.backend.importer.skip.bwastr=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
292 -Dflys.backend.importer.skip.da50s=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
293 -Dflys.backend.importer.skip.da66s=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
294 -Dflys.backend.importer.skip.extra.wsts=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
295 -Dflys.backend.importer.skip.fixations=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
296 -Dflys.backend.importer.skip.flood.water=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
297 -Dflys.backend.importer.skip.flood.protection=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
298 -Dflys.backend.importer.skip.gauges=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
299 -Dflys.backend.importer.skip.historical.discharge.tables=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
300 -Dflys.backend.importer.skip.hyks=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
301 -Dflys.backend.importer.skip.official.lines=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
302 -Dflys.backend.importer.skip.prfs=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
303 -Dflys.backend.importer.skip.w80s=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
304 -Dflys.backend.importer.skip.wst=false \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
305 -Dflys.backend.importer.skip.waterlevel.differences=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
306 -Dflys.backend.importer.skip.waterlevels=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
307 -Dflys.backend.importer.skip.sq.relation=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
308 -Dflys.backend.importer.skip.sediment.density=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
309 -Dflys.backend.importer.skip.sediment.yield=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
310 -Dflys.backend.importer.skip.morphological.width=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
311 -Dflys.backend.importer.skip.flow.velocity=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
312 -Dflys.backend.importer.skip.bed.height.single=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
313 -Dflys.backend.importer.skip.bed.height.epoch=true \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
314 $JAR
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
315 }
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
316
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
317 import_geo(){
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
318 LOG_FILE=${LOG_DIR}/geo.log
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
319 echo Importing Geographic data.
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
320 echo Logging into: $LOG_FILE
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
321
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
322 python $DIR/geodaesie/shpimporter.py \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
323 --directory $RIVER_PATH \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
324 --river_name $RIVER_NAME \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
325 --ogr_connection "$OGR_CONNECTION" \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
326 --host $HOST \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
327 --user $USER \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
328 --password $PASS \
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
329 --verbose 2 2>&1 > "$LOG_FILE"
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
330 }
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
331
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
332
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
333 if [ "$SKIP_HYDRO" != "TRUE" ]; then
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
334 import_hydro
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
335 fi
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
336 if [ "$SKIP_WST" != "TRUE" ]; then
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
337 import_wst
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
338 fi
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
339 if [ "$SKIP_MORPHO" != "TRUE" ]; then
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
340 import_morpho
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
341 fi
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
342 if [ "$SKIP_GEO" != "TRUE" ]; then
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
343 import_geo
a0abb6787ab1 Add first version of import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
344 fi

http://dive4elements.wald.intevation.org