diff --git a/.env b/.env index d664449c..5a182c86 100644 --- a/.env +++ b/.env @@ -29,21 +29,13 @@ MAX_ZOOM=7 # Use true (case sensitive) to allow data updates DIFF_MODE=false -# Some area data like openstreetmap.fr can contain invalid references -# that must be cleaned up before using it for borders -- set it to true. -BORDERS_CLEANUP=false - # The current setup assumes this file is placed inside the data/ dir MBTILES_FILE=tiles.mbtiles + # This is the current repl_config.json location, pre-configured in the tools Dockerfile # Makefile and quickstart replace it with the dynamically generated one, but we keep it here in case some other method is used to run. IMPOSM_CONFIG_FILE=/usr/src/app/config/repl_config.json -# import-borders temp files - set them here to defaults, and override in the Makefile based on the area -BORDERS_CLEANUP_FILE=data/borders/cleanup.pbf -BORDERS_PBF_FILE=data/borders/filtered.pbf -BORDERS_CSV_FILE=data/borders/lines.csv - # Number of parallel processes to use when importing sql files MAX_PARALLEL_PSQL=5 diff --git a/.github/workflows/integrity.yml b/.github/workflows/integrity.yml index 5ba95030..c46aa11c 100644 --- a/.github/workflows/integrity.yml +++ b/.github/workflows/integrity.yml @@ -15,7 +15,7 @@ jobs: steps: - name: Checkout the changes - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Run quickstart for a small area env: @@ -27,7 +27,7 @@ jobs: ./quickstart.sh $area - name: Save quickstart.log - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: quickstart.log path: quickstart.log diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 3266dbda..6b8649d4 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -45,7 +45,7 @@ jobs: - name: Cache test data download id: cache-testdata - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ci_cache key: "v2-${{ env.TEST_DATA_URL }}" @@ -58,7 +58,7 @@ jobs: curl --silent --show-error --location --output ci_cache/perf-test-areas-latest.osm.pbf "$TEST_DATA_URL" - name: Get code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: # Fetch the last two commits in case this is a PR, # and we need to profile the base branch first @@ -76,10 +76,10 @@ jobs: # Take the first parent of the grafted commit (cannot use HEAD^1 with shallow clones) REV_HASH=$(git cat-file -p $REV_HASH | awk 'NR > 1 {if(/^parent/){print $2; exit}}') fi - echo "::set-output name=hash::$REV_HASH" + echo "hash=$REV_HASH" >> $GITHUB_OUTPUT - name: Set up caching for the performance results - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: perf_cache # If profiling result cache has incompatible format, increase this "v" number @@ -287,14 +287,14 @@ jobs: fi - name: Save performance artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: performance_results path: artifacts - name: Save PR message artifact if: github.event_name == 'pull_request' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: pr_message path: pr_message diff --git a/.github/workflows/sql-tests.yml b/.github/workflows/sql-tests.yml index b301f055..895d6b88 100644 --- a/.github/workflows/sql-tests.yml +++ b/.github/workflows/sql-tests.yml @@ -15,7 +15,7 @@ jobs: steps: - name: Checkout the changes - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Run unit tests run: | diff --git a/LICENSE.md b/LICENSE.md index 626555b4..52c81b85 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2023, MapTiler.com & OpenMapTiles contributors. +Copyright (c) 2024, MapTiler.com & OpenMapTiles contributors. All rights reserved. The vector tile schema has been developed by Klokan Technologies GmbH and diff --git a/Makefile b/Makefile index b7c22a00..03132cb3 100644 --- a/Makefile +++ b/Makefile @@ -289,7 +289,7 @@ ifeq (,$(wildcard build/sql/run_last.sql)) $(DOCKER_COMPOSE) run $(DC_OPTS) openmaptiles-tools bash -c \ 'generate-sql $(TILESET_FILE) --dir ./build/sql \ && generate-sqltomvt $(TILESET_FILE) \ - --key --gzip --postgis-ver 3.0.1 \ + --key --gzip --postgis-ver 3.2.3 \ --function --fname=getmvt >> ./build/sql/run_last.sql' endif diff --git a/README.md b/README.md index ebfb8536..c4afc403 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,7 @@ make build-style Now you are ready to **generate the vector tiles**. By default, `./.env` specifies the entire planet BBOX for zooms 0-7, but running `generate-bbox-file` will analyze the data file and set the `BBOX` param to limit tile generation. ``` -make generate-bbox-file # compute data bbox -- not needed for the whole planet +make generate-bbox-file # compute data bbox -- not needed for the whole planet or for downloaded area by `make download` make generate-tiles-pg # generate tiles ``` @@ -175,17 +175,19 @@ make download area=albania # download albania .osm.pbf file -- can be skipped i make import-osm # import data into postgres make import-wikidata # import Wikidata make import-sql # create / import sql functions -make generate-bbox-file # compute data bbox -- not needed for the whole planet +make generate-bbox-file # compute data bbox -- not needed for the whole planet or for downloaded area by `make download` make generate-tiles-pg # generate tiles ``` Instead of calling `make download area=albania` you can add a .osm.pbf file in the `data` folder `openmaptiles/data/your_area_file.osm.pbf` +To change the name of the output filename, you can modify the variable `MBTILES_FILE` in the `.env` file or set up the environment variable `MBTILES_FILE` before running `./quickstart.sh` or `make generate-tiles-pg` (e.g., `MBTILES_FILENAME=monaco.mbtiles ./quickstart.sh monaco`). + ## License All code in this repository is under the [BSD license](./LICENSE.md). Design and the cartography decisions encoded in the schema and SQL are licensed under [CC-BY](./LICENSE.md). -Products or services using maps derived from OpenMapTiles schema need to visibly credit "OpenMapTiles.org" or reference "OpenMapTiles" with a link to https://openmaptiles.org/. Exceptions to attribution requirement can be granted on request. +Products or services using maps derived from OpenMapTiles schema need to **visibly credit "OpenMapTiles.org"** or **reference "OpenMapTiles"** with a link to https://openmaptiles.org/. Exceptions to attribution requirement can be granted on request. For a browsable electronic map based on OpenMapTiles and OpenStreetMap data, the credit should appear in the corner of the map. For example: diff --git a/quickstart.sh b/quickstart.sh index d82b4470..41585cd0 100755 --- a/quickstart.sh +++ b/quickstart.sh @@ -163,12 +163,7 @@ else echo " " fi -# override the output filename based on the area if the default `tiles.mbtiles` is found -if [[ "$(source .env ; echo "$MBTILES_FILE")" = "tiles.mbtiles" ]]; then - MBTILES_FILENAME=${area}.mbtiles -else - MBTILES_FILENAME=$(source .env ; echo "$MBTILES_FILE") -fi +MBTILES_FILE=${MBTILES_FILE:-$(source .env ; echo "$MBTILES_FILE")} echo " " echo "-------------------------------------------------------------------------------------" @@ -187,8 +182,8 @@ make init-dirs echo " " echo "-------------------------------------------------------------------------------------" -echo "====> : Removing old MBTILES if exists ( ./data/$MBTILES_FILENAME ) " -rm -f "./data/$MBTILES_FILENAME" +echo "====> : Removing old MBTILES if exists ( ./data/$MBTILES_FILE ) " +rm -f "./data/$MBTILES_FILE" echo " " echo "-------------------------------------------------------------------------------------" @@ -299,9 +294,9 @@ fi echo " " echo "-------------------------------------------------------------------------------------" echo "====> : Start generating MBTiles (containing gzipped MVT PBF) using PostGIS. " -echo " : Output MBTiles: $MBTILES_FILENAME " +echo " : Output MBTiles: $MBTILES_FILE " echo " : Source code: https://github.com/openmaptiles/openmaptiles-tools/blob/master/bin/generate-tiles " -MBTILES_FILE=$MBTILES_FILENAME make generate-tiles-pg +make generate-tiles-pg echo " " echo "-------------------------------------------------------------------------------------" @@ -332,7 +327,7 @@ docker images | grep openmaptiles echo " " echo "-------------------------------------------------------------------------------------" -echo "====> : (disk space) We have created the new vectortiles ( ./data/$MBTILES_FILENAME ) " +echo "====> : (disk space) We have created the new vectortiles ( ./data/$MBTILES_FILE ) " echo " : Please respect the licenses (OdBL for OSM data) of the sources when distributing the MBTiles file." echo " : Data directory content:" ls -la ./data @@ -356,8 +351,11 @@ echo " Acknowledgments " 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 "-------------------------------------------------------------------------------------" +echo " " +echo -e "\033[1m Maps made with these vector tiles must display a visible credit:\033[0m " echo " © OpenMapTiles © OpenStreetMap contributors " echo " " +echo "-------------------------------------------------------------------------------------" echo " Thanks to all free, open source software developers and Open Data Contributors! " echo "-------------------------------------------------------------------------------------"