view flys-backend/contrib/run_geo.sh @ 5509:627584bc0586

Datacage: Added <dc:filter> element. This allows cleaner way to narrow the datasets. Example: <dc:context> <dc:statement> SELECT DISTINCT name AS hws_name, official AS hws_official, kind_id AS hws_kind FROM hws_lines WHERE river_id = ${river_id} </dc:statement> <dc:if test="dc:has-result()"> <lines> <dc:macro name="hws-lines"> <dc:elements> <hws factory="hwsfactory" name="{$hws_name}"/> </dc:elements> </dc:macro> <dc:filter expr="$hws_official=1"> <dc:if test="dc:has-result()"> <official> <dc:filter expr="$hws_kind=1"> <dc:if test="dc:has-result()"> <Durchlass><dc:call-macro name="hws-lines"></Durchlass> </dc:if> </dc:filter> <dc:filter expr="$hws_kind=2"> <dc:if test="dc:has-result()"> <Damm><dc:call-macro name="hws-lines"></Damm> </dc:if> </dc:filter> <dc:filter expr="$hws_kind=3"> <dc:if test="dc:has-result()"> <Graben><dc:call-macro name="hws-lines"></Graben> </dc:if> </dc:filter> </official> </dc:if> </dc:filter> </lines> </dc:if> </dc:context>
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 28 Mar 2013 16:51:15 +0100
parents d086ce6c13d3
children ed149d5d7fb7
line wrap: on
line source
#!/bin/sh

# Required
RIVER_PATH="/vol1/projects/Geospatial/flys-3.0/testdaten/Gewaesser/Saar"
RIVER_NAME="Saar"

# Set this to your target database for Oracle
HOST=localhost
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_GAUGE_LOCATION=0
SKIP_CATCHMENTS=0
SKIP_UESG=0
SKIP_DGM=0
SKIP_JETTIES=0

# There should be no need to change anything below this line

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 \
    --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_gauge_locations $SKIP_GAUGE_LOCATION \
    --skip_uesgs $SKIP_UESG \
    --skip_hws_lines $SKIP_HWS_LINES \
    --skip_hws_points $SKIP_HWS_POINTS \
    --skip_dgm $SKIP_DGM \
    --skip_jetties $SKIP_JETTIES

http://dive4elements.wald.intevation.org