mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-25 09:26:17 -05:00
Splitting map scripts to offer initializing and resetting map.
This commit is contained in:
parent
aef7f1162d
commit
3ef6ceb06f
5 changed files with 155 additions and 69 deletions
|
|
@ -17,6 +17,13 @@ if [ "${1}" == "" ]; then
|
|||
exit 3
|
||||
fi
|
||||
|
||||
HAS_ICE_SHEET=false
|
||||
psql gis wrolpi -c '\d' | grep icesheet_polygons && HAS_ICE_SHEET=true
|
||||
if [ ${HAS_ICE_SHEET} = false ]; then
|
||||
echo "Missing icesheet_polygons. Run reset_map.sh"
|
||||
exit 4
|
||||
fi
|
||||
|
||||
function cleanup() {
|
||||
if [ -f ${MERGED_TMP_FILE} ]; then
|
||||
rm ${MERGED_TMP_FILE}
|
||||
|
|
@ -60,11 +67,11 @@ if [[ ${1} == *.osm.pbf ]]; then
|
|||
elif [[ ${1} == *.dump ]]; then
|
||||
if [ ! -f "${1}" ]; then
|
||||
echo "File does not exist! ${1}"
|
||||
exit 4
|
||||
exit 7
|
||||
fi
|
||||
# Import a Postgresql dump.
|
||||
nice -n 18 pg_restore -j3 --no-owner -d gis "${1}"
|
||||
else
|
||||
echo "Cannot import unknown map file"
|
||||
exit 7
|
||||
exit 8
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue