mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-25 01:16:18 -05:00
Reworking map import to handle postgres data dumps.
This commit is contained in:
parent
be4c3a5021
commit
5178f72b66
11 changed files with 194 additions and 109 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue