Skip to content

Commit

Permalink
Add more log messages to track the import process
Browse files Browse the repository at this point in the history
  • Loading branch information
tpetillon committed Dec 13, 2024
1 parent 13dabdf commit ffd739a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions scripts/docker-startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ test $i -gt $MAXCOUNT && echo "Timeout while waiting for PostgreSQL to be runnin
case "$1" in
import)
# Creating default database
echo "Creating database"
psql -c "SELECT 1 FROM pg_database WHERE datname = 'gis';" | grep -q 1 || createdb gis
psql -d gis -c 'CREATE EXTENSION IF NOT EXISTS postgis;'
psql -d gis -c 'CREATE EXTENSION IF NOT EXISTS hstore;'
Expand All @@ -41,6 +42,7 @@ EOF
fi

# Importing data to a database
echo "Importing data from $OSM2PGSQL_DATAFILE"
osm2pgsql \
--cache $OSM2PGSQL_CACHE \
--number-processes $OSM2PGSQL_NUMPROC \
Expand All @@ -52,6 +54,7 @@ EOF
$OSM2PGSQL_DATAFILE

# Setting up indexes and functions
echo "Setting up indexes and functions"
psql -d gis -f indexes.sql
psql -d gis -f functions.sql

Expand Down
3 changes: 2 additions & 1 deletion scripts/get-external-data.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def main():
config["settings"]["metadata_table"])

for name, source in config["sources"].items():
logging.info("Checking table {}".format(name))
logging.info("Table {}".format(name))
# Don't attempt to handle strange names
# Even if there was code to escape them properly here, you don't want
# in a style with all the quoting headaches
Expand All @@ -327,6 +327,7 @@ def main():
config["settings"]["metadata_table"])
this_table.clean_temp()

logging.info(" Downloading file {}".format(source["url"]))
# This will fetch data needed for import
download = d.download(source["url"], name, opts, data_dir, this_table.last_modified())

Expand Down
9 changes: 6 additions & 3 deletions scripts/get-fonts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ mkdir -p "${FONTDIR}"

# download filename url
download() {
echo "Downloading file $2"
## Download if newer, and if curl fails, clean up and exit
curl --fail --compressed -A "get-fonts.sh/osm-carto" -o "$1" -z "$1" -L "$2" || { echo "Failed to download $1 $2"; rm -f "$1"; exit 1; }
curl --fail -s --compressed -A "get-fonts.sh/osm-carto" -o "$1" -z "$1" -L "$2" || { echo "Failed to download $1 $2"; rm -f "$1"; exit 1; }
}

# TTF Hinted Noto Fonts
Expand Down Expand Up @@ -84,6 +85,8 @@ NotoSansYi"

# Download the fonts in the lists above

echo "Downloading fonts"

for font in $REGULAR_BOLD_ITALIC; do
regular="$font-Regular.ttf"
bold="$font-Bold.ttf"
Expand Down Expand Up @@ -121,12 +124,12 @@ TMPDIR=$(mktemp -d -t get-fonts.XXXXXXXXX)
trap "rm -rf ${TMPDIR} ${FONTDIR}/static" EXIT

# Noto Emoji B&W isn't available as a separate download, so we need to download the package and unzip it
curl --fail -A "get-fonts.sh/osm-carto" -o "${TMPDIR}/Noto_Emoji.zip" -L 'https://fonts.google.com/download?family=Noto%20Emoji'
download "${TMPDIR}/Noto_Emoji.zip" 'https://fonts.google.com/download?family=Noto%20Emoji'

unzip -oqq "${TMPDIR}/Noto_Emoji.zip" static/NotoEmoji-Regular.ttf static/NotoEmoji-Bold.ttf -d "${FONTDIR}"
mv "${FONTDIR}/static/NotoEmoji-Regular.ttf" "${FONTDIR}"
mv "${FONTDIR}/static/NotoEmoji-Bold.ttf" "${FONTDIR}"

curl --fail -A "get-fonts.sh/osm-carto" -o "${TMPDIR}/hanazono.zip" -L 'https://mirrors.dotsrc.org/osdn/hanazono-font/68253/hanazono-20170904.zip'
download "${TMPDIR}/hanazono.zip" 'https://mirrors.dotsrc.org/osdn/hanazono-font/68253/hanazono-20170904.zip'

unzip -oqq "${TMPDIR}/hanazono.zip" HanaMinA.ttf HanaMinB.ttf -d "${FONTDIR}"

0 comments on commit ffd739a

Please sign in to comment.