Upgrade to tools v5 - rm import-osm, new downloader... (#785)
Update to tools v5. See https://github.com/openmaptiles/openmaptiles-tools/releases/tag/v5.0.0 for the list of all changes. Other OMT-repo specific changes: * removes `import-osm` docker usage, replacing it with `openmaptiles-tools` * quickstart builds faster because it uses postgres with preloaded water, natural earth, and lake centerlines tables. ### Makefile targets * `tools-dev` will open a shell in a docker to experiment and debug (instead of `import-sql-dev` and `import-osm-dev`) * separated `start-maputnik` from `start-postserve` * renamed `clean-docker` into `db-destroy` to make it more explicit * cleaner `db-start`, `db-stop`, `db-destroy` targets * `db-start-preloaded` is the same as `db-start`, except that it uses `postgis-preloaded` -- an image with preloaded water, natural-earth, and lake centerline data * `db-start` will not recreate the container if it already exists -- this way if it was started as preloaded, it will not be rebuilt. * better output messages ### Quickstart * uses `postgis-preloaded` image by default to make quickstart quicker. To start with a clean db, pass 2 parameters to quickstart, e.g. `./quickstart.sh albania empty`
This commit is contained in:
@@ -66,6 +66,11 @@ if [ "$(version "$DOCKER_VER")" -lt "$(version "$MIN_DOCKER_VER")" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# If there are no arguments, or just the area is set, use preloaded docker image to speed up
|
||||
# to force all steps, use two arguments, e.g. "./quickstart monaco empty"
|
||||
(( $# == 0 || $# == 1 )) && USE_PRELOADED_IMAGE=true || USE_PRELOADED_IMAGE=""
|
||||
export USE_PRELOADED_IMAGE
|
||||
|
||||
echo " "
|
||||
echo "-------------------------------------------------------------------------------------"
|
||||
echo "====> : Pulling or refreshing OpenMapTiles docker images "
|
||||
@@ -82,6 +87,7 @@ echo "--------------------------------------------------------------------------
|
||||
echo "====> : OpenMapTiles quickstart! [ https://github.com/openmaptiles/openmaptiles ] "
|
||||
echo " : This will be logged to the $log_file file (for debugging) and to the screen"
|
||||
echo " : Area : $osm_area "
|
||||
echo " : Preloaded Image : $USE_PRELOADED_IMAGE "
|
||||
echo " : Git version : $githash "
|
||||
echo " : Started : $STARTDATE "
|
||||
echo " : Your bash version: $BASH_VERSION"
|
||||
@@ -166,30 +172,42 @@ make all
|
||||
|
||||
echo " "
|
||||
echo "-------------------------------------------------------------------------------------"
|
||||
echo "====> : Start PostgreSQL service ; create PostgreSQL data volume "
|
||||
echo " : Source code: https://github.com/openmaptiles/postgis "
|
||||
echo " : Thank you: https://www.postgresql.org ! Thank you http://postgis.org !"
|
||||
make db-start
|
||||
|
||||
echo " "
|
||||
echo "-------------------------------------------------------------------------------------"
|
||||
echo "====> : Drop and Recreate PostgreSQL public schema "
|
||||
# Drop all PostgreSQL tables
|
||||
# This adds an extra safety belt if the user modifies the docker volume settings
|
||||
make forced-clean-sql
|
||||
|
||||
echo "====> : Importing all the data:"
|
||||
echo " : * Water data from http://osmdata.openstreetmap.de"
|
||||
echo " : Data license: https://osmdata.openstreetmap.de/info/license.html"
|
||||
echo " : * Natural Earth from http://www.naturalearthdata.com"
|
||||
echo " : Terms-of-use: http://www.naturalearthdata.com/about/terms-of-use"
|
||||
echo " : * OpenStreetMap Lakelines data https://github.com/lukasmartinelli/osm-lakelines"
|
||||
echo " :"
|
||||
echo " : Source code: https://github.com/openmaptiles/openmaptiles-tools/tree/master/docker/import-data"
|
||||
echo " : includes all data from the import-data image"
|
||||
echo " :"
|
||||
echo " : Thank you: https://www.postgresql.org ! Thank you http://postgis.org !"
|
||||
make import-data
|
||||
if [[ "$USE_PRELOADED_IMAGE" == true ]]; then
|
||||
echo "====> : Start PostgreSQL service using postgis image preloaded with this data:"
|
||||
echo " : * Water data from http://osmdata.openstreetmap.de"
|
||||
echo " : Data license: https://osmdata.openstreetmap.de/info/license.html"
|
||||
echo " : * Natural Earth from http://www.naturalearthdata.com"
|
||||
echo " : Terms-of-use: http://www.naturalearthdata.com/about/terms-of-use"
|
||||
echo " : * OpenStreetMap Lakelines data https://github.com/lukasmartinelli/osm-lakelines"
|
||||
echo " :"
|
||||
echo " : Source code: https://github.com/openmaptiles/openmaptiles-tools/tree/master/docker/import-data"
|
||||
echo " : includes all data from the import-data image"
|
||||
echo " :"
|
||||
echo " : Use two-parameter quickstart to start with an empty database:"
|
||||
echo " : ./quickstart.sh albania empty"
|
||||
echo " : If desired, you can manually import data by one using these commands:"
|
||||
echo " : make db-destroy"
|
||||
echo " : make db-start"
|
||||
echo " : make import-data"
|
||||
echo " :"
|
||||
echo " : Source code: https://github.com/openmaptiles/openmaptiles-tools/tree/master/docker/postgis-preloaded"
|
||||
echo " : Thank you: https://www.postgresql.org ! Thank you http://postgis.org !"
|
||||
make db-start-preloaded
|
||||
else
|
||||
echo "====> : Start PostgreSQL service using empty database and importing all the data:"
|
||||
echo " : * Water data from http://osmdata.openstreetmap.de"
|
||||
echo " : Data license: https://osmdata.openstreetmap.de/info/license.html"
|
||||
echo " : * Natural Earth from http://www.naturalearthdata.com"
|
||||
echo " : Terms-of-use: http://www.naturalearthdata.com/about/terms-of-use"
|
||||
echo " : * OpenStreetMap Lakelines data https://github.com/lukasmartinelli/osm-lakelines"
|
||||
echo " :"
|
||||
echo " : Source code: https://github.com/openmaptiles/openmaptiles-tools/tree/master/docker/import-data"
|
||||
echo " : includes all data from the import-data image"
|
||||
echo " :"
|
||||
echo " : Thank you: https://www.postgresql.org ! Thank you http://postgis.org !"
|
||||
make db-start
|
||||
make import-data
|
||||
fi
|
||||
|
||||
echo " "
|
||||
echo "-------------------------------------------------------------------------------------"
|
||||
|
||||
Reference in New Issue
Block a user