Reworking map import to handle postgres data dumps.

This commit is contained in:
Roland 2022-03-31 07:31:15 -06:00
parent be4c3a5021
commit 5178f72b66
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
11 changed files with 194 additions and 109 deletions

View file

@ -11,15 +11,24 @@ if [ ! -f /opt/openstreetmap-carto/openstreetmap-carto.style ]; then
fi
if [ "${1}" == "" ]; then
echo "Missing PBF file argument."
echo "Missing file argument."
exit 3
fi
if [ ! -f "${1}" ]; then
echo "PBF file does not exist! ${1}"
echo "File does not exist! ${1}"
exit 4
fi
osm2pgsql -d gis --append --slim -G --hstore --tag-transform-script \
/opt/openstreetmap-carto/openstreetmap-carto.lua -C 2000 --number-processes 4 \
-S /opt/openstreetmap-carto/openstreetmap-carto.style "${1}"
if [[ ${1} == *.osm.pbf ]]; then
# Import a PBF file.
osm2pgsql -d gis --append --slim -G --hstore --tag-transform-script \
/opt/openstreetmap-carto/openstreetmap-carto.lua -C 2000 --number-processes 4 \
-S /opt/openstreetmap-carto/openstreetmap-carto.style "${1}"
elif [[ ${1} == *.dump ]]; then
# Import a Postgresql dump.
pg_restore -j4 --no-owner -d gis "${1}"
else
echo "Cannot import unknown map file"
exit 5
fi

View file

@ -85,7 +85,7 @@ fi
set -e
cp /opt/wrolpi/etc/ubuntu20.04/rendred.conf /usr/local/etc/renderd.conf
cp /opt/wrolpi/etc/ubuntu20.04/renderd.conf /usr/local/etc/renderd.conf
# Enable mod_tile.
cp /opt/wrolpi/etc/ubuntu20.04/mod_tile.conf /etc/apache2/conf-available/mod_tile.conf