kopia lustrzana https://github.com/openmaptiles/openmaptiles
Merge branch 'master' into improve-shop-style
commit
ab8c765b1e
10
.env
10
.env
|
@ -29,21 +29,13 @@ MAX_ZOOM=7
|
||||||
# Use true (case sensitive) to allow data updates
|
# Use true (case sensitive) to allow data updates
|
||||||
DIFF_MODE=false
|
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
|
# The current setup assumes this file is placed inside the data/ dir
|
||||||
MBTILES_FILE=tiles.mbtiles
|
MBTILES_FILE=tiles.mbtiles
|
||||||
|
|
||||||
# This is the current repl_config.json location, pre-configured in the tools Dockerfile
|
# 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.
|
# 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
|
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
|
# Number of parallel processes to use when importing sql files
|
||||||
MAX_PARALLEL_PSQL=5
|
MAX_PARALLEL_PSQL=5
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout the changes
|
- name: Checkout the changes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Run quickstart for a small area
|
- name: Run quickstart for a small area
|
||||||
env:
|
env:
|
||||||
|
@ -27,7 +27,7 @@ jobs:
|
||||||
./quickstart.sh $area
|
./quickstart.sh $area
|
||||||
|
|
||||||
- name: Save quickstart.log
|
- name: Save quickstart.log
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: quickstart.log
|
name: quickstart.log
|
||||||
path: quickstart.log
|
path: quickstart.log
|
||||||
|
|
|
@ -45,7 +45,7 @@ jobs:
|
||||||
|
|
||||||
- name: Cache test data download
|
- name: Cache test data download
|
||||||
id: cache-testdata
|
id: cache-testdata
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ci_cache
|
path: ci_cache
|
||||||
key: "v2-${{ env.TEST_DATA_URL }}"
|
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"
|
curl --silent --show-error --location --output ci_cache/perf-test-areas-latest.osm.pbf "$TEST_DATA_URL"
|
||||||
|
|
||||||
- name: Get code
|
- name: Get code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
# Fetch the last two commits in case this is a PR,
|
# Fetch the last two commits in case this is a PR,
|
||||||
# and we need to profile the base branch first
|
# 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)
|
# 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}}')
|
REV_HASH=$(git cat-file -p $REV_HASH | awk 'NR > 1 {if(/^parent/){print $2; exit}}')
|
||||||
fi
|
fi
|
||||||
echo "::set-output name=hash::$REV_HASH"
|
echo "hash=$REV_HASH" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Set up caching for the performance results
|
- name: Set up caching for the performance results
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: perf_cache
|
path: perf_cache
|
||||||
# If profiling result cache has incompatible format, increase this "v" number
|
# If profiling result cache has incompatible format, increase this "v" number
|
||||||
|
@ -287,14 +287,14 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Save performance artifacts
|
- name: Save performance artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: performance_results
|
name: performance_results
|
||||||
path: artifacts
|
path: artifacts
|
||||||
|
|
||||||
- name: Save PR message artifact
|
- name: Save PR message artifact
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: pr_message
|
name: pr_message
|
||||||
path: pr_message
|
path: pr_message
|
||||||
|
|
|
@ -15,7 +15,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout the changes
|
- name: Checkout the changes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
Copyright (c) 2023, MapTiler.com & OpenMapTiles contributors.
|
Copyright (c) 2024, MapTiler.com & OpenMapTiles contributors.
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
The vector tile schema has been developed by Klokan Technologies GmbH and
|
The vector tile schema has been developed by Klokan Technologies GmbH and
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -289,7 +289,7 @@ ifeq (,$(wildcard build/sql/run_last.sql))
|
||||||
$(DOCKER_COMPOSE) run $(DC_OPTS) openmaptiles-tools bash -c \
|
$(DOCKER_COMPOSE) run $(DC_OPTS) openmaptiles-tools bash -c \
|
||||||
'generate-sql $(TILESET_FILE) --dir ./build/sql \
|
'generate-sql $(TILESET_FILE) --dir ./build/sql \
|
||||||
&& generate-sqltomvt $(TILESET_FILE) \
|
&& 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'
|
--function --fname=getmvt >> ./build/sql/run_last.sql'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -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.
|
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
|
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-osm # import data into postgres
|
||||||
make import-wikidata # import Wikidata
|
make import-wikidata # import Wikidata
|
||||||
make import-sql # create / import sql functions
|
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
|
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`
|
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
|
## 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).
|
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
|
For a browsable electronic map based on OpenMapTiles and OpenStreetMap data, the
|
||||||
credit should appear in the corner of the map. For example:
|
credit should appear in the corner of the map. For example:
|
||||||
|
|
|
@ -163,12 +163,7 @@ else
|
||||||
echo " "
|
echo " "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# override the output filename based on the area if the default `tiles.mbtiles` is found
|
MBTILES_FILE=${MBTILES_FILE:-$(source .env ; echo "$MBTILES_FILE")}
|
||||||
if [[ "$(source .env ; echo "$MBTILES_FILE")" = "tiles.mbtiles" ]]; then
|
|
||||||
MBTILES_FILENAME=${area}.mbtiles
|
|
||||||
else
|
|
||||||
MBTILES_FILENAME=$(source .env ; echo "$MBTILES_FILE")
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
echo "-------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------"
|
||||||
|
@ -187,8 +182,8 @@ make init-dirs
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
echo "-------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------"
|
||||||
echo "====> : Removing old MBTILES if exists ( ./data/$MBTILES_FILENAME ) "
|
echo "====> : Removing old MBTILES if exists ( ./data/$MBTILES_FILE ) "
|
||||||
rm -f "./data/$MBTILES_FILENAME"
|
rm -f "./data/$MBTILES_FILE"
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
echo "-------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------"
|
||||||
|
@ -299,9 +294,9 @@ fi
|
||||||
echo " "
|
echo " "
|
||||||
echo "-------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------"
|
||||||
echo "====> : Start generating MBTiles (containing gzipped MVT PBF) using PostGIS. "
|
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 "
|
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 " "
|
||||||
echo "-------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------"
|
||||||
|
@ -332,7 +327,7 @@ docker images | grep openmaptiles
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
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 " : Please respect the licenses (OdBL for OSM data) of the sources when distributing the MBTiles file."
|
||||||
echo " : Data directory content:"
|
echo " : Data directory content:"
|
||||||
ls -la ./data
|
ls -la ./data
|
||||||
|
@ -356,8 +351,11 @@ echo " Acknowledgments "
|
||||||
echo " Generated vector tiles are produced work of OpenStreetMap data. "
|
echo " Generated vector tiles are produced work of OpenStreetMap data. "
|
||||||
echo " Such tiles are reusable under CC-BY license granted by OpenMapTiles team: "
|
echo " Such tiles are reusable under CC-BY license granted by OpenMapTiles team: "
|
||||||
echo " https://github.com/openmaptiles/openmaptiles/#license "
|
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 " © OpenMapTiles © OpenStreetMap contributors "
|
||||||
echo " "
|
echo " "
|
||||||
|
echo "-------------------------------------------------------------------------------------"
|
||||||
echo " Thanks to all free, open source software developers and Open Data Contributors! "
|
echo " Thanks to all free, open source software developers and Open Data Contributors! "
|
||||||
echo "-------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------"
|
||||||
|
|
Ładowanie…
Reference in New Issue