Skip to content
This repository has been archived by the owner on Jan 9, 2020. It is now read-only.

Commit

Permalink
Allow specifying diff mode
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmartinelli committed Oct 24, 2016
1 parent 37137aa commit 9ccd278
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions import_osm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,27 @@ set -o pipefail
set -o nounset

readonly PG_CONNECT="postgis://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/$POSTGRES_DB"
readonly DIFF_MODE=${DIFF_MODE:-true}


function import_pbf() {
local pbf_file="$1"
echo "Importing in diff mode"
local diff_flag=""
if [ "$DIFF_MODE" = true ]; then
diff_flag="-diff"
echo "Importing in diff mode"
else
echo "Importing in normal mode"
fi

imposm3 import \
-connection "$PG_CONNECT" \
-mapping "$MAPPING_YAML" \
-overwritecache \
-cachedir "$IMPOSM_CACHE_DIR" \
-read "$pbf_file" \
-deployproduction \
-write -diff
-write $diff_flag
}

function import_osm_with_first_pbf() {
Expand Down

0 comments on commit 9ccd278

Please sign in to comment.