view backend/contrib/run_geo.sh @ 8709:71ae18553377

(issue1754) Also fixup master artifact for already loaded recommendations As the load many call creates (and needs to create) all artifacts in the reccomendations this would break "old" recommendations after a reload through the "Pencil" mode. A better fix would probably be to just set the master artifiact in the recommendations but due to the extremly weird interaction with the server at this point it is not trivial to identify how this can be done.
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 24 Apr 2015 15:57:23 +0200
parents b2e167f193d7
children f7c49975cc15
line wrap: on
line source
#!/bin/bash

# Set this to your target database for Oracle
HOST=localhost
BACKEND_NAME="XE"
USER=flys28
PASS=flys28
# Alternatively you can provide a direct connection string:
# OGR_CONNECTION="PG:dbname=flys host=localhost port=5432 user=flys password=flys"

# Optional
VERBOSE=1
SKIP_AXIS=0
SKIP_KMS=0
SKIP_CROSSSECTIONS=0
SKIP_FIXPOINTS=0
SKIP_BUILDINGS=0
SKIP_FLOODPLAINS=0
SKIP_HYDR_BOUNDARIES=0
SKIP_HWS_LINES=0
SKIP_HWS_POINTS=0
SKIP_UESG=0
SKIP_DGM=0
SKIP_JETTIES=0
SKIP_FLOODMARKS=0

# Default encoding. Change here if necessary
export LC_ALL=de_DE@euro

# There should be no need to change anything below this line
GEW_FILE="$1"
RIVER_NAME=$(grep "Gew.sser" "$1" | sed 's/Gew.sser: //')

RIVER_PATH=$(grep "WSTDatei:" "$GEW_FILE" | awk '{print $2}')
RIVER_PATH=$(dirname "$RIVER_PATH")/../..
RIVER_PATH=$(readlink -f "$RIVER_PATH")

DIR=`dirname $0`
DIR=`readlink -f "$DIR"`

OPTIONAL_LIBS="${DIR}"/opt
if [ -d "$OPTIONAL_LIBS" ]; then
    export PATH="$OPTIONAL_LIBS/bin:$PATH"
    export LD_LIBRARY_PATH="$OPTIONAL_LIBS/lib:$LD_LIBRARY_PATH"
    export LD_LIBRARY_PATH="$OPTIONAL_LIBS/lib64:$LD_LIBRARY_PATH"
    export PYTHONPATH="$OPTIONAL_LIBS/lib/python2.6/site-packages:$PYTHONPATH"
    export PYTHONPATH="$OPTIONAL_LIBS/lib64/python2.6/site-packages:$PYTHONPATH"
    export GDAL_DATA="$OPTIONAL_LIBS/share/gdal"
fi

exec python $DIR/shpimporter/shpimporter.py \
    --directory $RIVER_PATH \
    --river_name "$RIVER_NAME" \
    --ogr_connection "$OGR_CONNECTION" \
    --host $HOST/$BACKEND_NAME \
    --user $USER \
    --password $PASS \
    --verbose $VERBOSE \
    --skip_axis $SKIP_AXIS \
    --skip_kms $SKIP_KMS \
    --skip_crosssections $SKIP_CROSSSECTIONS \
    --skip_fixpoints $SKIP_FIXPOINTS \
    --skip_buildings $SKIP_BUILDINGS \
    --skip_floodplains $SKIP_FLOODPLAINS \
    --skip_hydr_boundaries $SKIP_HYDR_BOUNDARIES \
    --skip_uesgs $SKIP_UESG \
    --skip_hws_lines $SKIP_HWS_LINES \
    --skip_hws_points $SKIP_HWS_POINTS \
    --skip_dgm $SKIP_DGM \
    --skip_jetties $SKIP_JETTIES \
    --skip_floodmarks $SKIP_FLOODMARKS \
    2>&1

http://dive4elements.wald.intevation.org