Use area name for mbtiles in quickstart.sh (#1523)

Some parts of quickstart.sh reference `${area}.mbtiles`, but the file that gets created with the default `.env` is `tiles.mbtiles`. We should either reference `$MBTILES_FILE` instead, or override the filename with `${area}.mbtiles` (which is the approach taken by this PR).
pull/1526/head^2
William Edmisten 2023-05-10 03:33:44 -04:00 zatwierdzone przez GitHub
rodzic 9969c5c741
commit 5153dffe4a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 12 dodań i 5 usunięć

Wyświetl plik

@ -163,6 +163,13 @@ else
echo " "
fi
# override the output filename based on the area if the default `tiles.mbtiles` is found
if [[ "$(source .env ; echo "$MBTILES_FILE")" = "tiles.mbtiles" ]]; then
MBTILES_FILENAME=${area}.mbtiles
else
MBTILES_FILENAME=$(source .env ; echo "$MBTILES_FILE")
fi
echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : Stopping running services & removing old containers"
@ -180,8 +187,8 @@ make init-dirs
echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : Removing old MBTILES if exists ( ./data/${area}.mbtiles ) "
rm -f "./data/${area}.mbtiles"
echo "====> : Removing old MBTILES if exists ( ./data/$MBTILES_FILENAME ) "
rm -f "./data/$MBTILES_FILENAME"
echo " "
echo "-------------------------------------------------------------------------------------"
@ -292,9 +299,9 @@ fi
echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : Start generating MBTiles (containing gzipped MVT PBF) using PostGIS. "
echo " : Output MBTiles: ./data/${area}.mbtiles "
echo " : Output MBTiles: $MBTILES_FILENAME "
echo " : Source code: https://github.com/openmaptiles/openmaptiles-tools/blob/master/bin/generate-tiles "
make generate-tiles-pg
MBTILES_FILE=$MBTILES_FILENAME make generate-tiles-pg
echo " "
echo "-------------------------------------------------------------------------------------"
@ -326,7 +333,7 @@ docker images | grep openmaptiles
echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : (disk space) We have created the new vectortiles ( ./data/${area}.mbtiles ) "
echo "====> : (disk space) We have created the new vectortiles ( ./data/$MBTILES_FILENAME ) "
echo " : Please respect the licenses (OdBL for OSM data) of the sources when distributing the MBTiles file."
echo " : Data directory content:"
ls -la ./data