2016-11-11 16:28:37 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -o errexit
|
|
|
|
set -o pipefail
|
|
|
|
set -o nounset
|
|
|
|
|
2016-11-28 22:15:47 +00:00
|
|
|
|
|
|
|
###########################################
|
|
|
|
# OpenMapTiles quickstart.sh for x86_64 linux
|
|
|
|
#
|
2016-11-28 15:44:30 +00:00
|
|
|
# Example calls ...
|
2016-11-28 22:15:47 +00:00
|
|
|
# ./quickstart.sh
|
|
|
|
# ./quickstart.sh africa
|
|
|
|
# ./quickstart.sh alabama
|
|
|
|
# ./quickstart.sh alaska
|
|
|
|
# ./quickstart.sh albania
|
|
|
|
# ./quickstart.sh alberta
|
|
|
|
# ./quickstart.sh alps
|
2016-11-28 15:44:30 +00:00
|
|
|
# ....
|
2016-11-28 22:15:47 +00:00
|
|
|
#
|
2016-11-28 15:44:30 +00:00
|
|
|
# to list areas : make download-geofabrik-list
|
|
|
|
# see more QUICKSTART.md
|
2016-11-27 19:01:01 +00:00
|
|
|
#
|
|
|
|
|
2016-11-27 10:31:43 +00:00
|
|
|
if [ $# -eq 0 ]; then
|
2016-11-28 22:15:47 +00:00
|
|
|
osm_area=albania # default test country
|
|
|
|
echo "No parameter - set area=$osm_area "
|
|
|
|
else
|
2016-11-27 10:31:43 +00:00
|
|
|
osm_area=$1
|
|
|
|
fi
|
2020-05-06 15:27:14 +00:00
|
|
|
|
|
|
|
pbf_file="./data/${osm_area}-latest.osm.pbf"
|
2016-11-27 10:31:43 +00:00
|
|
|
|
2016-11-28 22:15:47 +00:00
|
|
|
## Min versions ...
|
2016-11-27 19:01:01 +00:00
|
|
|
MIN_COMPOSE_VER=1.7.1
|
2017-05-11 23:34:25 +00:00
|
|
|
MIN_DOCKER_VER=1.12.3
|
2016-11-15 22:02:28 +00:00
|
|
|
STARTTIME=$(date +%s)
|
2017-02-03 15:46:49 +00:00
|
|
|
STARTDATE=$(date +"%Y-%m-%dT%H:%M%z")
|
2016-11-15 22:02:28 +00:00
|
|
|
githash=$( git rev-parse HEAD )
|
|
|
|
|
2016-11-28 22:15:47 +00:00
|
|
|
log_file=./quickstart.log
|
2016-11-15 22:02:28 +00:00
|
|
|
rm -f $log_file
|
2016-12-09 15:59:47 +00:00
|
|
|
echo " "
|
|
|
|
echo "====================================================================================="
|
|
|
|
echo " Docker check & Download images "
|
|
|
|
echo "-------------------------------------------------------------------------------------"
|
2017-01-06 10:41:14 +00:00
|
|
|
echo "====> : Please check the Docker and docker-compose version!"
|
|
|
|
echo " : We are using docker-compose v2 file format! see more at https://docs.docker.com/"
|
|
|
|
echo " : Minimum required Docker version: $MIN_DOCKER_VER+"
|
|
|
|
echo " : Minimum required docker-compose version: $MIN_COMPOSE_VER+"
|
|
|
|
echo " : See the .travis build for the currently supported versions."
|
|
|
|
echo " : Your docker system:"
|
2016-12-09 15:59:47 +00:00
|
|
|
docker --version
|
|
|
|
docker-compose --version
|
|
|
|
|
2017-05-03 06:09:35 +00:00
|
|
|
# based on: http://stackoverflow.com/questions/16989598/bash-comparing-version-numbers
|
2020-02-20 06:35:42 +00:00
|
|
|
function version { echo "$@" | tr -cs '0-9.' '.' | awk -F. '{ printf("%03d%03d%03d\n", $1,$2,$3); }'; }
|
2017-01-20 15:25:15 +00:00
|
|
|
|
2016-12-09 15:59:47 +00:00
|
|
|
COMPOSE_VER=$(docker-compose version --short)
|
2017-01-20 15:25:15 +00:00
|
|
|
if [ "$(version "$COMPOSE_VER")" -lt "$(version "$MIN_COMPOSE_VER")" ]; then
|
2016-12-09 15:59:47 +00:00
|
|
|
echo "ERR: Your Docker-compose version is Known to have bugs , Please Update docker-compose!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
DOCKER_VER="$(docker -v | awk -F '[ ,]+' '{ print $3 }')"
|
2017-01-20 15:25:15 +00:00
|
|
|
if [ "$(version "$DOCKER_VER")" -lt "$(version "$MIN_DOCKER_VER")" ]; then
|
2017-01-06 10:41:14 +00:00
|
|
|
echo "ERR: Your Docker version is not compatible. Please Update docker!"
|
2016-12-09 15:59:47 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
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`
2020-05-05 15:53:09 +00:00
|
|
|
# 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
|
|
|
|
|
2016-12-09 15:59:47 +00:00
|
|
|
echo " "
|
|
|
|
echo "-------------------------------------------------------------------------------------"
|
2017-01-06 10:41:14 +00:00
|
|
|
echo "====> : Pulling or refreshing OpenMapTiles docker images "
|
2016-12-09 15:59:47 +00:00
|
|
|
make refresh-docker-images
|
|
|
|
|
|
|
|
|
|
|
|
##### backup log from here ...
|
2016-11-15 22:02:28 +00:00
|
|
|
exec &> >(tee -a "$log_file")
|
|
|
|
|
2016-11-16 00:45:44 +00:00
|
|
|
echo " "
|
2016-12-09 15:59:47 +00:00
|
|
|
echo "====================================================================================="
|
|
|
|
echo " Start processing "
|
2016-11-16 01:29:44 +00:00
|
|
|
echo "-------------------------------------------------------------------------------------"
|
|
|
|
echo "====> : OpenMapTiles quickstart! [ https://github.com/openmaptiles/openmaptiles ] "
|
2017-01-06 10:49:11 +00:00
|
|
|
echo " : This will be logged to the $log_file file (for debugging) and to the screen"
|
2016-12-09 15:59:47 +00:00
|
|
|
echo " : Area : $osm_area "
|
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`
2020-05-05 15:53:09 +00:00
|
|
|
echo " : Preloaded Image : $USE_PRELOADED_IMAGE "
|
2016-12-09 15:59:47 +00:00
|
|
|
echo " : Git version : $githash "
|
|
|
|
echo " : Started : $STARTDATE "
|
|
|
|
echo " : Your bash version: $BASH_VERSION"
|
|
|
|
echo " : Your OS : $OSTYPE"
|
|
|
|
docker --version
|
|
|
|
docker-compose --version
|
2016-11-16 00:45:44 +00:00
|
|
|
|
2016-11-30 02:34:19 +00:00
|
|
|
if [[ "$OSTYPE" == "linux-gnu" ]]; then
|
|
|
|
echo " "
|
|
|
|
echo "-------------------------------------------------------------------------------------"
|
|
|
|
echo " : This is working on x86_64 ; Your kernel is:"
|
|
|
|
uname -r
|
|
|
|
uname -m
|
|
|
|
|
|
|
|
KERNEL_CPU_VER=$(uname -m)
|
|
|
|
if [ "$KERNEL_CPU_VER" != "x86_64" ]; then
|
2016-12-09 15:59:47 +00:00
|
|
|
echo "ERR: Sorry this is working only on x86_64!"
|
|
|
|
exit 1
|
2016-11-30 02:34:19 +00:00
|
|
|
fi
|
|
|
|
echo " : --- Memory, CPU info ---- "
|
|
|
|
mem=$( grep MemTotal /proc/meminfo | awk '{print $2}' | xargs -I {} echo "scale=4; {}/1024^2" | bc )
|
2019-12-11 14:26:25 +00:00
|
|
|
echo "system memory (GB): ${mem}"
|
2016-11-30 02:34:19 +00:00
|
|
|
grep SwapTotal /proc/meminfo
|
2020-04-22 06:48:57 +00:00
|
|
|
echo "cpu number: $(grep -c processor /proc/cpuinfo) x $(grep "bogomips" /proc/cpuinfo | head -1)"
|
|
|
|
grep Free /proc/meminfo
|
2016-11-30 02:34:19 +00:00
|
|
|
else
|
|
|
|
echo " "
|
2017-01-06 10:49:11 +00:00
|
|
|
echo "Warning : Platforms other than Linux are less tested"
|
2016-11-30 02:34:19 +00:00
|
|
|
echo " "
|
2016-11-27 19:01:01 +00:00
|
|
|
fi
|
|
|
|
|
2016-11-16 00:45:44 +00:00
|
|
|
echo " "
|
2016-11-16 01:29:44 +00:00
|
|
|
echo "-------------------------------------------------------------------------------------"
|
2017-01-06 10:49:11 +00:00
|
|
|
echo "====> : Stopping running services & removing old containers"
|
2020-04-22 15:15:20 +00:00
|
|
|
make db-destroy
|
2016-11-15 22:02:28 +00:00
|
|
|
|
2016-11-16 00:45:44 +00:00
|
|
|
echo " "
|
2016-11-16 01:29:44 +00:00
|
|
|
echo "-------------------------------------------------------------------------------------"
|
2020-04-22 06:48:57 +00:00
|
|
|
echo "====> : Existing OpenMapTiles docker images. Will use version $(source .env && echo "$TOOLS_VERSION")"
|
2016-11-30 04:39:06 +00:00
|
|
|
docker images | grep openmaptiles
|
2016-11-11 16:28:37 +00:00
|
|
|
|
2016-11-16 00:45:44 +00:00
|
|
|
echo " "
|
2016-11-16 01:29:44 +00:00
|
|
|
echo "-------------------------------------------------------------------------------------"
|
2020-03-06 18:15:54 +00:00
|
|
|
echo "====> : Create directories if they don't exist"
|
|
|
|
make init-dirs
|
2016-11-11 16:28:37 +00:00
|
|
|
|
2016-11-16 00:45:44 +00:00
|
|
|
echo " "
|
2016-11-16 01:29:44 +00:00
|
|
|
echo "-------------------------------------------------------------------------------------"
|
2016-11-15 22:02:28 +00:00
|
|
|
echo "====> : Removing old MBTILES if exists ( ./data/*.mbtiles ) "
|
|
|
|
rm -f ./data/*.mbtiles
|
|
|
|
|
2020-05-06 15:27:14 +00:00
|
|
|
if [[ ! -f "${pbf_file}" || ! -f "./data/docker-compose-config.yml" ]]; then
|
2016-11-16 01:29:44 +00:00
|
|
|
echo " "
|
|
|
|
echo "-------------------------------------------------------------------------------------"
|
2020-04-09 14:49:35 +00:00
|
|
|
echo "====> : Downloading ${osm_area} from Geofabrik..."
|
|
|
|
rm -rf ./data/*
|
2019-12-11 14:26:25 +00:00
|
|
|
make download-geofabrik "area=${osm_area}"
|
2016-11-15 22:02:28 +00:00
|
|
|
else
|
2016-11-16 01:29:44 +00:00
|
|
|
echo " "
|
|
|
|
echo "-------------------------------------------------------------------------------------"
|
2020-05-06 15:27:14 +00:00
|
|
|
echo "====> : The pbf file $pbf_file exists, we don't need to download!"
|
2016-11-11 16:28:37 +00:00
|
|
|
fi
|
|
|
|
|
2016-11-27 10:31:43 +00:00
|
|
|
|
2020-05-06 15:27:14 +00:00
|
|
|
if [ ! -f "${pbf_file}" ]; then
|
2016-11-27 10:31:43 +00:00
|
|
|
echo " "
|
2020-05-06 15:27:14 +00:00
|
|
|
echo "Missing $pbf_file , Download or Parameter error? "
|
2019-12-11 14:26:25 +00:00
|
|
|
exit 1
|
2016-11-27 10:31:43 +00:00
|
|
|
fi
|
|
|
|
|
2016-11-15 22:02:28 +00:00
|
|
|
echo " "
|
2016-11-16 01:29:44 +00:00
|
|
|
echo "-------------------------------------------------------------------------------------"
|
2016-11-15 22:54:53 +00:00
|
|
|
echo "====> : Remove old generated source files ( ./build/* ) ( if they exist ) "
|
2019-03-22 08:34:00 +00:00
|
|
|
make clean
|
2016-11-11 16:28:37 +00:00
|
|
|
|
2016-11-15 22:02:28 +00:00
|
|
|
echo " "
|
2016-11-16 01:29:44 +00:00
|
|
|
echo "-------------------------------------------------------------------------------------"
|
2016-11-15 22:02:28 +00:00
|
|
|
echo "====> : Code generating from the layer definitions ( ./build/mapping.yaml; ./build/tileset.sql )"
|
2016-11-15 22:54:53 +00:00
|
|
|
echo " : The tool source code: https://github.com/openmaptiles/openmaptiles-tools "
|
|
|
|
echo " : But we generate the tm2source, Imposm mappings and SQL functions from the layer definitions! "
|
2020-04-22 06:48:57 +00:00
|
|
|
make all
|
2016-11-15 22:02:28 +00:00
|
|
|
|
|
|
|
echo " "
|
2016-11-16 01:29:44 +00:00
|
|
|
echo "-------------------------------------------------------------------------------------"
|
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`
2020-05-05 15:53:09 +00:00
|
|
|
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
|
2016-11-15 22:02:28 +00:00
|
|
|
|
|
|
|
echo " "
|
2016-11-16 01:29:44 +00:00
|
|
|
echo "-------------------------------------------------------------------------------------"
|
2020-05-06 15:27:14 +00:00
|
|
|
echo "====> : Start importing OpenStreetMap data: ${pbf_file} -> imposm3[./build/mapping.yaml] -> PostgreSQL"
|
2016-11-15 22:02:28 +00:00
|
|
|
echo " : Imposm3 documentation: https://imposm.org/docs/imposm3/latest/index.html "
|
|
|
|
echo " : Thank you Omniscale! "
|
2019-12-11 14:26:25 +00:00
|
|
|
echo " : Source code: https://github.com/openmaptiles/openmaptiles-tools/tree/master/docker/import-osm "
|
2016-11-15 22:02:28 +00:00
|
|
|
echo " : The OpenstreetMap data license: https://www.openstreetmap.org/copyright (ODBL) "
|
2016-11-28 22:15:47 +00:00
|
|
|
echo " : Thank you OpenStreetMap Contributors ! "
|
2020-05-06 15:27:14 +00:00
|
|
|
make import-osm "PBF_FILE=${pbf_file}"
|
2020-03-06 18:15:54 +00:00
|
|
|
|
|
|
|
echo " "
|
|
|
|
echo "-------------------------------------------------------------------------------------"
|
2020-05-06 15:27:14 +00:00
|
|
|
echo "====> : Start importing border data from ${pbf_file} into PostgreSQL using osmborder"
|
2020-03-06 18:15:54 +00:00
|
|
|
echo " : Source code: https://github.com/pnorman/osmborder"
|
|
|
|
echo " : Data license: http://www.openstreetmap.org/copyright"
|
|
|
|
echo " : Thank you: Paul Norman"
|
|
|
|
make import-borders
|
2016-11-15 22:02:28 +00:00
|
|
|
|
|
|
|
echo " "
|
2016-11-16 01:29:44 +00:00
|
|
|
echo "-------------------------------------------------------------------------------------"
|
2020-04-09 14:49:35 +00:00
|
|
|
echo "====> : Start importing Wikidata: Wikidata Query Service -> PostgreSQL"
|
|
|
|
echo " : The Wikidata license: CC0 - https://www.wikidata.org/wiki/Wikidata:Main_Page "
|
|
|
|
echo " : Thank you Wikidata Contributors ! "
|
|
|
|
make import-wikidata
|
|
|
|
|
|
|
|
echo " "
|
|
|
|
echo "-------------------------------------------------------------------------------------"
|
|
|
|
echo "====> : Start SQL postprocessing: ./build/sql/* -> PostgreSQL "
|
2020-01-24 19:40:03 +00:00
|
|
|
echo " : Source code: https://github.com/openmaptiles/openmaptiles-tools/blob/master/bin/import-sql"
|
2019-12-14 08:00:25 +00:00
|
|
|
# If the output contains a WARNING, stop further processing
|
|
|
|
# Adapted from https://unix.stackexchange.com/questions/307562
|
2020-05-04 17:28:23 +00:00
|
|
|
make import-sql
|
2016-11-11 16:28:37 +00:00
|
|
|
|
2017-01-20 22:30:02 +00:00
|
|
|
echo " "
|
|
|
|
echo "-------------------------------------------------------------------------------------"
|
|
|
|
echo "====> : Analyze PostgreSQL tables"
|
|
|
|
make psql-analyze
|
|
|
|
|
2017-05-10 22:35:01 +00:00
|
|
|
echo " "
|
|
|
|
echo "-------------------------------------------------------------------------------------"
|
2019-12-12 17:40:31 +00:00
|
|
|
echo "====> : Testing PostgreSQL tables to match layer definitions metadata"
|
2020-04-09 14:49:35 +00:00
|
|
|
make test-perf-null
|
2017-05-10 22:35:01 +00:00
|
|
|
|
2016-11-15 22:02:28 +00:00
|
|
|
echo " "
|
2016-11-16 01:29:44 +00:00
|
|
|
echo "-------------------------------------------------------------------------------------"
|
2016-11-15 22:02:28 +00:00
|
|
|
echo "====> : Start generating MBTiles (containing gzipped MVT PBF) from a TM2Source project. "
|
|
|
|
echo " : TM2Source project definitions : ./build/openmaptiles.tm2source/data.yml "
|
2016-11-15 22:54:53 +00:00
|
|
|
echo " : Output MBTiles: ./data/tiles.mbtiles "
|
2019-12-11 14:26:25 +00:00
|
|
|
echo " : Source code: https://github.com/openmaptiles/openmaptiles-tools/tree/master/docker/generate-vectortiles "
|
2016-11-15 22:02:28 +00:00
|
|
|
echo " : We are using a lot of Mapbox Open Source tools! : https://github.com/mapbox "
|
|
|
|
echo " : Thank you https://www.mapbox.com !"
|
|
|
|
echo " : See other MVT tools : https://github.com/mapbox/awesome-vector-tiles "
|
2016-11-16 09:20:08 +00:00
|
|
|
echo " : "
|
|
|
|
echo " : You will see a lot of deprecated warning in the log! This is normal! "
|
|
|
|
echo " : like : Mapnik LOG> ... is deprecated and will be removed in Mapnik 4.x ... "
|
2020-03-06 18:15:54 +00:00
|
|
|
make generate-tiles
|
2017-01-08 12:22:19 +00:00
|
|
|
|
|
|
|
echo " "
|
|
|
|
echo "-------------------------------------------------------------------------------------"
|
2016-11-15 22:02:28 +00:00
|
|
|
echo "====> : Stop PostgreSQL service ( but we keep PostgreSQL data volume for debugging )"
|
2020-03-06 18:15:54 +00:00
|
|
|
make db-stop
|
2016-11-15 22:02:28 +00:00
|
|
|
|
|
|
|
echo " "
|
2016-11-16 01:29:44 +00:00
|
|
|
echo "-------------------------------------------------------------------------------------"
|
2016-11-16 00:54:27 +00:00
|
|
|
echo "====> : Inputs - Outputs md5sum for debugging "
|
2016-11-28 22:15:47 +00:00
|
|
|
rm -f ./data/quickstart_checklist.chk
|
2020-04-22 06:48:57 +00:00
|
|
|
{
|
|
|
|
find build -type f | sort | xargs md5sum ;
|
|
|
|
find data -type f | sort | xargs md5sum ;
|
|
|
|
} >> ./data/quickstart_checklist.chk
|
2016-11-28 22:15:47 +00:00
|
|
|
cat ./data/quickstart_checklist.chk
|
|
|
|
|
|
|
|
ENDTIME=$(date +%s)
|
2017-07-03 06:21:05 +00:00
|
|
|
if stat --help >/dev/null 2>&1; then
|
2020-05-06 15:27:14 +00:00
|
|
|
MODDATE=$(stat -c %y "${pbf_file}" )
|
2017-07-03 06:21:05 +00:00
|
|
|
else
|
2020-05-06 15:27:14 +00:00
|
|
|
MODDATE=$(stat -f%Sm -t '%F %T %z' "${pbf_file}" )
|
2017-07-03 06:21:05 +00:00
|
|
|
fi
|
2016-11-16 01:16:18 +00:00
|
|
|
|
|
|
|
echo " "
|
|
|
|
echo " "
|
2016-11-16 01:29:44 +00:00
|
|
|
echo "-------------------------------------------------------------------------------------"
|
|
|
|
echo "-- S u m m a r y --"
|
|
|
|
echo "-------------------------------------------------------------------------------------"
|
2016-11-15 22:02:28 +00:00
|
|
|
echo " "
|
2016-11-16 01:29:44 +00:00
|
|
|
echo "-------------------------------------------------------------------------------------"
|
2016-11-15 22:02:28 +00:00
|
|
|
echo "====> : (disk space) We have created a lot of docker images: "
|
2016-11-15 22:54:53 +00:00
|
|
|
echo " : Hint: you can remove with: docker rmi IMAGE "
|
2016-11-15 22:02:28 +00:00
|
|
|
docker images | grep openmaptiles
|
|
|
|
|
|
|
|
echo " "
|
2016-11-16 01:29:44 +00:00
|
|
|
echo "-------------------------------------------------------------------------------------"
|
2016-11-15 22:02:28 +00:00
|
|
|
echo "====> : (disk space) We have created the new vectortiles ( ./data/tiles.mbtiles ) "
|
2017-01-06 10:56:09 +00:00
|
|
|
echo " : Please respect the licenses (OdBL for OSM data) of the sources when distributing the MBTiles file."
|
2020-05-06 15:27:14 +00:00
|
|
|
echo " : Created from $pbf_file ( file moddate: $MODDATE ) "
|
2016-11-15 22:02:28 +00:00
|
|
|
echo " : Size: "
|
2017-07-03 06:21:05 +00:00
|
|
|
ls -la ./data/*.mbtiles
|
2016-11-15 22:02:28 +00:00
|
|
|
|
2016-11-27 10:31:43 +00:00
|
|
|
echo " "
|
|
|
|
echo "-------------------------------------------------------------------------------------"
|
2016-11-28 15:44:30 +00:00
|
|
|
echo "The ./quickstart.sh $osm_area is finished! "
|
2019-12-11 14:26:25 +00:00
|
|
|
echo "It takes $((ENDTIME - STARTTIME)) seconds to complete"
|
2016-11-16 01:16:18 +00:00
|
|
|
echo "We saved the log file to $log_file ( for debugging ) You can compare with the travis log !"
|
2016-11-28 22:15:47 +00:00
|
|
|
echo " "
|
2017-01-06 10:56:09 +00:00
|
|
|
echo "Start experimenting! And check the QUICKSTART.MD file!"
|
2019-12-12 17:40:31 +00:00
|
|
|
echo " "
|
2020-04-22 15:15:20 +00:00
|
|
|
echo "* Use make maputnik-start to explore tile generation on request"
|
|
|
|
echo "* Use make tileserver-start to view pre-generated tiles"
|
2019-12-12 17:40:31 +00:00
|
|
|
echo " "
|
2017-01-06 10:56:09 +00:00
|
|
|
echo "Available help commands (make help) "
|
2016-11-30 04:39:06 +00:00
|
|
|
make help
|
|
|
|
|
2016-11-28 15:44:30 +00:00
|
|
|
echo "-------------------------------------------------------------------------------------"
|
|
|
|
echo " Acknowledgments "
|
2017-05-03 06:09:35 +00:00
|
|
|
echo " Generated vector tiles are produced work of OpenStreetMap data. "
|
|
|
|
echo " Such tiles are reusable under CC-BY license granted by OpenMapTiles team: "
|
|
|
|
echo " https://github.com/openmaptiles/openmaptiles/#license "
|
|
|
|
echo " Maps made with these vector tiles must display a visible credit: "
|
|
|
|
echo " © OpenMapTiles © OpenStreetMap contributors "
|
|
|
|
echo " "
|
2017-01-06 10:56:09 +00:00
|
|
|
echo " Thanks to all free, open source software developers and Open Data Contributors! "
|
2016-11-16 01:29:44 +00:00
|
|
|
echo "-------------------------------------------------------------------------------------"
|