-
Notifications
You must be signed in to change notification settings - Fork 0
/
openmaptiles-20-overview
executable file
·66 lines (52 loc) · 2.7 KB
/
openmaptiles-20-overview
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/bash
set -e
# Planet z0-z6
wget -P pbf https://planet.openstreetmap.org/pbf/planet-latest.osm.pbf
docker-compose run --rm build bash -e -c "
cd /data/pbf
time osmium tags-filter planet-latest.osm.pbf w/highway=motorway,trunk --overwrite -o planet-highway-latest.osm.pbf
time osmium tags-filter planet-latest.osm.pbf w/railway=rail --overwrite -o planet-rails-latest.osm.pbf
time osmium tags-filter planet-latest.osm.pbf n/place=city,continent,country,island,ocean,sea,state --overwrite -o planet-places-latest.osm.pbf
time osmium tags-filter planet-latest.osm.pbf a/boundary=administrative -R -f pbf | osmium tags-filter -F pbf - a/admin_level=1,2,3,4 -R --overwrite -o planet-boundary_noref-latest.osm.pbf
time osmium getid planet-latest.osm.pbf -r -I planet-boundary_noref-latest.osm.pbf --overwrite -o planet-boundary-latest.osm.pbf
time osmium tags-filter planet-latest.osm.pbf a/natural=water -R -f pbf | osmium tags-filter -F pbf - a/water=lake -R -f pbf | osmium tags-filter -F pbf - a/name=* -R --overwrite -o planet-lake_noref-latest.osm.pbf
time osmium getid planet-latest.osm.pbf -r -I planet-lake_noref-latest.osm.pbf --overwrite -o planet-lake-latest.osm.pbf
time osmium tags-filter planet-latest.osm.pbf a/leisure=nature_reserve a/boundary=national_park -R --overwrite -o planet-park_noref-latest.osm.pbf
time osmium getid planet-latest.osm.pbf -r -I planet-park_noref-latest.osm.pbf --overwrite -o planet-park-latest.osm.pbf
time osmium merge -v --progress \
--overwrite -o planet-z0-z6.osm.pbf \
planet-highway-latest.osm.pbf \
planet-rails-latest.osm.pbf \
planet-places-latest.osm.pbf \
planet-boundary-latest.osm.pbf \
planet-lake-latest.osm.pbf \
planet-park-latest.osm.pbf
"
rm -f \
pbf/planet-highway-latest.osm.pbf \
pbf/planet-rails-latest.osm.pbf \
pbf/planet-places-latest.osm.pbf \
pbf/planet-boundary-latest.osm.pbf \
pbf/planet-boundary_noref-latest.osm.pbf \
pbf/planet-lake-latest.osm.pbf \
pbf/planet-park-latest.osm.pbf \
pbf/planet-lake_noref-latest.osm.pbf \
pbf/planet-park_noref-latest.osm.pbf
rm -f openmaptiles/data/*.pbf
cp pbf/planet-z0-z6.osm.pbf openmaptiles/data/
cd openmaptiles
time bash -c "\
docker-compose down -v && \
docker-compose run --rm openmaptiles-tools bash -c 'chmod a+w /cache/ && rm -fr build' && \
make && \
make import-data && \
make import-osm area=planet-z0-z6 && \
make import-sql && \
make import-wikidata && \
make analyze-db
"
sed -i 's/MIN_ZOOM.*/MIN_ZOOM=0/' .env && \
sed -i 's/MAX_ZOOM.*/MAX_ZOOM=6/' .env && \
make generate-tiles area=planet-z0-z6
cd ..
mv -f openmaptiles/data/tiles.mbtiles mbtiles/openmaptiles-v3-z0-z6.mbtiles