diff --git a/.env.example b/.env.example index aae7e6be..8f08e01a 100644 --- a/.env.example +++ b/.env.example @@ -10,7 +10,8 @@ PGPASSWORD='mysecretpassword' # Application flags OSM_DOWNLOAD_URL='http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf' -SKIP_DOWNLOAD=1 # skips the download (if a file already exists) and tag filtering +SKIP_DOWNLOAD=1 # skips the download if a file already exists +SKIP_TAG_FILTER=0 # skips tag filtering DEBUG=1 # enables the generation of exclude tables ID_FILTER='' # if not empty only the objects with these ids are processed. See https://docs.osmcode.org/osmium/latest/osmium-getid.html diff --git a/app/run-1-download.sh b/app/run-1-download.sh index cfbcfd9a..00f3e557 100755 --- a/app/run-1-download.sh +++ b/app/run-1-download.sh @@ -10,8 +10,7 @@ if [ $SKIP_DOWNLOAD == 1 ]; then echo "💥 SKIPPED with .env 'SKIP_DOWNLOAD=1'" exit 0; else - echo "Can't skip download, no file was found. Update .env to 'SKIP_DOWNLOAD=0'" - exit 1; + echo "Can't skip download, no file was found." fi fi diff --git a/app/run-2-filter.sh b/app/run-2-filter.sh index 1f3a5663..a6609123 100755 --- a/app/run-2-filter.sh +++ b/app/run-2-filter.sh @@ -11,14 +11,9 @@ OSM_INTERMEDIATE_FILE=${FILTER_DIR}intermediate.pbf start_time=$(date +%s) echo -e "\e[1m\e[7m FILTER – START \e[27m\e[21m – Start Time: $(date)\e[0m" -if [ $SKIP_DOWNLOAD == 1 ]; then - if [ -f "${OSM_FILTERED_FILE}" ]; then - echo "💥 SKIPPED tag filter with .env 'SKIP_DOWNLOAD=1'" - exit 0; - else - echo "Can't skip tag filter, no file was found. Update .env to 'SKIP_DOWNLOAD=0'" - exit 1; - fi +if [ $SKIP_TAG_FILTER == 1 ]; then + echo "💥 SKIPPED tag filter with .env 'SKIP_TAG_FILTER=1'" + mv ${OSM_LOCAL_FILE} ${OSM_FILTERED_FILE} else # Docs https://docs.osmcode.org/osmium/latest/osmium-tags-filter.html osmium tags-filter --overwrite --expressions ${OSM_FILTER_EXPRESSIONS} --output=${OSM_FILTERED_FILE} ${OSM_LOCAL_FILE} diff --git a/app/run.sh b/app/run.sh index 28dbfe65..10f445bc 100755 --- a/app/run.sh +++ b/app/run.sh @@ -8,6 +8,7 @@ export OSM_FILTERED_FILE=${OSM_DATADIR}openstreetmap-filtered.osm.pbf # define default args export SKIP_DOWNLOAD=${SKIP_DOWNLOAD:-0} +export SKIP_TAG_FILTER=${SKIP_TAG_FILTER:-0} export DEBUG=${DEBUG:-0} export ID_FILTER=${ID_FILTER:-''} export SYNOLOGY_URL='https://fixmy.diskstation.me:54545/webapi/entry.cgi?api=SYNO.Chat.External&method=incoming&version=2&token=' diff --git a/docker-compose.development.yml b/docker-compose.development.yml index 4da29337..fe3e1409 100644 --- a/docker-compose.development.yml +++ b/docker-compose.development.yml @@ -13,6 +13,7 @@ services: PGPASSWORD: OSM_DOWNLOAD_URL: SKIP_DOWNLOAD: + SKIP_TAG_FILTER: DEBUG: ID_FILTER: API_SECRET: