Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
Fix "Remove "SKIP_TAG_FILTER" flag; Use "mv" instead of "ln""
Browse files Browse the repository at this point in the history
  • Loading branch information
rush42 committed Jan 15, 2024
1 parent 0c9a289 commit 6331f52
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions app/run-1-download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 3 additions & 8 deletions app/run-2-filter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
1 change: 1 addition & 0 deletions app/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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='
Expand Down
1 change: 1 addition & 0 deletions docker-compose.development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ services:
PGPASSWORD:
OSM_DOWNLOAD_URL:
SKIP_DOWNLOAD:
SKIP_TAG_FILTER:
DEBUG:
ID_FILTER:
API_SECRET:
Expand Down

0 comments on commit 6331f52

Please sign in to comment.