Mercurial > dive4elements > river
annotate backend/contrib/run_geo.sh @ 9802:a9641367812c 3.2.x
Improve locale support in artifacts container
Makes it easier to run scripts e.g. for importing data.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Wed, 29 May 2024 10:51:00 +0200 |
parents | f7c49975cc15 |
children |
rev | line source |
---|---|
7458
b2e167f193d7
run_geo.sh: allow logging as documented.
Tom Gottfried <tom.gottfried@intevation.de>
parents:
6815
diff
changeset
|
1 #!/bin/bash |
3683
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
4873
2b371e42a9af
Add HWS Lines parameters and ogr_connection example
Andre Heinecke <aheinecke@intevation.de>
parents:
3683
diff
changeset
|
3 # Set this to your target database for Oracle |
3683
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 HOST=localhost |
6658
89f856e24d27
Importer scripts: shpimporter needs backend name to play with Oracle.
Tom Gottfried <tom@intevation.de>
parents:
6651
diff
changeset
|
5 BACKEND_NAME="XE" |
3683
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 USER=flys28 |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 PASS=flys28 |
4873
2b371e42a9af
Add HWS Lines parameters and ogr_connection example
Andre Heinecke <aheinecke@intevation.de>
parents:
3683
diff
changeset
|
8 # Alternatively you can provide a direct connection string: |
2b371e42a9af
Add HWS Lines parameters and ogr_connection example
Andre Heinecke <aheinecke@intevation.de>
parents:
3683
diff
changeset
|
9 # OGR_CONNECTION="PG:dbname=flys host=localhost port=5432 user=flys password=flys" |
3683
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 # Optional |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 VERBOSE=1 |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 SKIP_AXIS=0 |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 SKIP_KMS=0 |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 SKIP_CROSSSECTIONS=0 |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 SKIP_FIXPOINTS=0 |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 SKIP_BUILDINGS=0 |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 SKIP_FLOODPLAINS=0 |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 SKIP_HYDR_BOUNDARIES=0 |
4873
2b371e42a9af
Add HWS Lines parameters and ogr_connection example
Andre Heinecke <aheinecke@intevation.de>
parents:
3683
diff
changeset
|
20 SKIP_HWS_LINES=0 |
2b371e42a9af
Add HWS Lines parameters and ogr_connection example
Andre Heinecke <aheinecke@intevation.de>
parents:
3683
diff
changeset
|
21 SKIP_HWS_POINTS=0 |
3683
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 SKIP_UESG=0 |
5035
1f33012cc02a
Add skip-dgm option to example run script
Andre Heinecke <aheinecke@intevation.de>
parents:
4996
diff
changeset
|
23 SKIP_DGM=0 |
5353
d086ce6c13d3
Add jetties importer
Andre Heinecke <aheinecke@intevation.de>
parents:
5074
diff
changeset
|
24 SKIP_JETTIES=0 |
5545
ed149d5d7fb7
Add floodmarks importer
Andre Heinecke <aheinecke@intevation.de>
parents:
5353
diff
changeset
|
25 SKIP_FLOODMARKS=0 |
3683
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 |
6651
8782ba5cb222
Importer scripts: add default encoding to correctly read gew-files
Tom Gottfried <tom@intevation.de>
parents:
5838
diff
changeset
|
27 # Default encoding. Change here if necessary |
8782ba5cb222
Importer scripts: add default encoding to correctly read gew-files
Tom Gottfried <tom@intevation.de>
parents:
5838
diff
changeset
|
28 export LC_ALL=de_DE@euro |
8782ba5cb222
Importer scripts: add default encoding to correctly read gew-files
Tom Gottfried <tom@intevation.de>
parents:
5838
diff
changeset
|
29 |
5066
8208df10df79
Update run example scripts to work with the new packaging
Andre Heinecke <aheinecke@intevation.de>
parents:
5035
diff
changeset
|
30 # There should be no need to change anything below this line |
6805
0b2c9de5e681
Geo-importer: use commandline-argument instead of configuration for river selection.
Tom Gottfried <tom.gottfried@intevation.de>
parents:
6658
diff
changeset
|
31 GEW_FILE="$1" |
0b2c9de5e681
Geo-importer: use commandline-argument instead of configuration for river selection.
Tom Gottfried <tom.gottfried@intevation.de>
parents:
6658
diff
changeset
|
32 RIVER_NAME=$(grep "Gew.sser" "$1" | sed 's/Gew.sser: //') |
0b2c9de5e681
Geo-importer: use commandline-argument instead of configuration for river selection.
Tom Gottfried <tom.gottfried@intevation.de>
parents:
6658
diff
changeset
|
33 |
0b2c9de5e681
Geo-importer: use commandline-argument instead of configuration for river selection.
Tom Gottfried <tom.gottfried@intevation.de>
parents:
6658
diff
changeset
|
34 RIVER_PATH=$(grep "WSTDatei:" "$GEW_FILE" | awk '{print $2}') |
0b2c9de5e681
Geo-importer: use commandline-argument instead of configuration for river selection.
Tom Gottfried <tom.gottfried@intevation.de>
parents:
6658
diff
changeset
|
35 RIVER_PATH=$(dirname "$RIVER_PATH")/../.. |
0b2c9de5e681
Geo-importer: use commandline-argument instead of configuration for river selection.
Tom Gottfried <tom.gottfried@intevation.de>
parents:
6658
diff
changeset
|
36 RIVER_PATH=$(readlink -f "$RIVER_PATH") |
5066
8208df10df79
Update run example scripts to work with the new packaging
Andre Heinecke <aheinecke@intevation.de>
parents:
5035
diff
changeset
|
37 |
3683
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 DIR=`dirname $0` |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 DIR=`readlink -f "$DIR"` |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 exec python $DIR/shpimporter/shpimporter.py \ |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 --directory $RIVER_PATH \ |
5563
673f68bb19a4
Geo-importer: accept river names with white space
Tom Gottfried <tom@intevation.de>
parents:
5545
diff
changeset
|
43 --river_name "$RIVER_NAME" \ |
4873
2b371e42a9af
Add HWS Lines parameters and ogr_connection example
Andre Heinecke <aheinecke@intevation.de>
parents:
3683
diff
changeset
|
44 --ogr_connection "$OGR_CONNECTION" \ |
6658
89f856e24d27
Importer scripts: shpimporter needs backend name to play with Oracle.
Tom Gottfried <tom@intevation.de>
parents:
6651
diff
changeset
|
45 --host $HOST/$BACKEND_NAME \ |
3683
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 --user $USER \ |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 --password $PASS \ |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 --verbose $VERBOSE \ |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 --skip_axis $SKIP_AXIS \ |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 --skip_kms $SKIP_KMS \ |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 --skip_crosssections $SKIP_CROSSSECTIONS \ |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 --skip_fixpoints $SKIP_FIXPOINTS \ |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 --skip_buildings $SKIP_BUILDINGS \ |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 --skip_floodplains $SKIP_FLOODPLAINS \ |
4298ef9bd4a6
Added run scripts for both importers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 --skip_hydr_boundaries $SKIP_HYDR_BOUNDARIES \ |
4873
2b371e42a9af
Add HWS Lines parameters and ogr_connection example
Andre Heinecke <aheinecke@intevation.de>
parents:
3683
diff
changeset
|
56 --skip_uesgs $SKIP_UESG \ |
2b371e42a9af
Add HWS Lines parameters and ogr_connection example
Andre Heinecke <aheinecke@intevation.de>
parents:
3683
diff
changeset
|
57 --skip_hws_lines $SKIP_HWS_LINES \ |
5035
1f33012cc02a
Add skip-dgm option to example run script
Andre Heinecke <aheinecke@intevation.de>
parents:
4996
diff
changeset
|
58 --skip_hws_points $SKIP_HWS_POINTS \ |
5353
d086ce6c13d3
Add jetties importer
Andre Heinecke <aheinecke@intevation.de>
parents:
5074
diff
changeset
|
59 --skip_dgm $SKIP_DGM \ |
5545
ed149d5d7fb7
Add floodmarks importer
Andre Heinecke <aheinecke@intevation.de>
parents:
5353
diff
changeset
|
60 --skip_jetties $SKIP_JETTIES \ |
7458
b2e167f193d7
run_geo.sh: allow logging as documented.
Tom Gottfried <tom.gottfried@intevation.de>
parents:
6815
diff
changeset
|
61 --skip_floodmarks $SKIP_FLOODMARKS \ |
b2e167f193d7
run_geo.sh: allow logging as documented.
Tom Gottfried <tom.gottfried@intevation.de>
parents:
6815
diff
changeset
|
62 2>&1 |