-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenmaptiles-40-update
executable file
·173 lines (160 loc) · 6.87 KB
/
openmaptiles-40-update
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#!/usr/bin/bash
set -e
docker-compose run --rm build bash -e -c "
cd /data/pbf
/usr/lib/python3-pyosmium/pyosmium-up-to-date -v france-latest.osm.pbf
/usr/lib/python3-pyosmium/pyosmium-up-to-date -v andorra-latest.osm.pbf
/usr/lib/python3-pyosmium/pyosmium-up-to-date -v guernsey-jersey-latest.osm.pbf
/usr/lib/python3-pyosmium/pyosmium-up-to-date -v luxembourg-latest.osm.pbf
/usr/lib/python3-pyosmium/pyosmium-up-to-date -v belgium-latest.osm.pbf
/usr/lib/python3-pyosmium/pyosmium-up-to-date -v spain-latest.osm.pbf
/usr/lib/python3-pyosmium/pyosmium-up-to-date -v madagascar-latest.osm.pbf
"
rm -f pbf/saint_pierre_et_miquelon-latest.osm.pbf
wget -P pbf http://download.openstreetmap.fr/extracts/north-america/saint_pierre_et_miquelon-latest.osm.pbf
rm -f pbf/martinique-latest.osm.pbf
wget -P pbf http://download.openstreetmap.fr/extracts/central-america/martinique-latest.osm.pbf
rm -f pbf/guadeloupe.osm.pbf
wget -P pbf http://download.openstreetmap.fr/extracts/central-america/guadeloupe.osm.pbf
rm -f pbf/guyane-latest.osm.pbf
wget -P pbf http://download.openstreetmap.fr/extracts/south-america/guyane-latest.osm.pbf
rm -f pbf/reunion-latest.osm.pbf
wget -P pbf http://download.openstreetmap.fr/extracts/africa/reunion-latest.osm.pbf
rm -f pbf/mayotte-latest.osm.pbf
wget -P pbf http://download.openstreetmap.fr/extracts/africa/mayotte-latest.osm.pbf
rm -f pbf/polynesie-latest.osm.pbf
wget -P pbf http://download.openstreetmap.fr/extracts/oceania/polynesie-latest.osm.pbf
docker-compose run --rm build bash -e -c "
cd /data/pbf
osmium merge -v --progress \
--overwrite -o merge.osm.pbf \
france-latest.osm.pbf \
andorra-latest.osm.pbf \
guernsey-jersey-latest.osm.pbf \
luxembourg-latest.osm.pbf \
belgium-latest.osm.pbf \
spain-latest.osm.pbf \
madagascar-latest.osm.pbf \
saint_pierre_et_miquelon-latest.osm.pbf \
martinique-latest.osm.pbf \
guadeloupe.osm.pbf \
guyane-latest.osm.pbf \
reunion-latest.osm.pbf \
mayotte-latest.osm.pbf \
polynesie-latest.osm.pbf
"
mkdir -p openmaptiles/data/
mv -f pbf/merge.osm.pbf openmaptiles/data/
cd openmaptiles
docker-compose down -v && \
rm -fr build
cd -
docker-compose run --rm build bash -e -c "
./ontology-build.sh && \\
ruby ontology2layer.rb tourism \\
ontology-tourism.json \\
openmaptiles/layers/poi_tourism/poi_tourism.yaml \\
openmaptiles/layers/poi_tourism/mapping.yaml \\
openmaptiles/layers/poi_tourism/class.sql && \\
ruby ontology2layer.rb city \\
ontology-city.json \\
openmaptiles/layers/poi_city/poi_city.yaml \\
openmaptiles/layers/poi_city/mapping.yaml \\
openmaptiles/layers/poi_city/class.sql \\
"
cd openmaptiles && \
make && \
make start-db && \
make import-data && \
make import-osm area=merge && \
make import-sql && \
make import-wikidata && \
make analyze-db && \
\
cp ../bbox/saint_pierre_et_miquelon-z7-z14.bbox data/merge.bbox && \
sed -i 's/MIN_ZOOM.*/MIN_ZOOM=7/' .env && \
sed -i 's/MAX_ZOOM.*/MAX_ZOOM=14/' .env && \
make generate-tiles area=merge && \
mv data/tiles.mbtiles ../mbtiles/openmaptiles-v3-saint_pierre_et_miquelon-z7-z14.mbtiles && \
\
cp ../bbox/antilles-z7-z14.bbox data/merge.bbox && \
sed -i 's/MIN_ZOOM.*/MIN_ZOOM=7/' .env && \
sed -i 's/MAX_ZOOM.*/MAX_ZOOM=14/' .env && \
make generate-tiles area=merge && \
mv data/tiles.mbtiles ../mbtiles/openmaptiles-v3-antilles-z7-z14.mbtiles && \
\
cp ../bbox/mayotte-z10-z14.bbox data/merge.bbox && \
sed -i 's/MIN_ZOOM.*/MIN_ZOOM=10/' .env && \
sed -i 's/MAX_ZOOM.*/MAX_ZOOM=14/' .env && \
make generate-tiles area=merge && \
mv data/tiles.mbtiles ../mbtiles/openmaptiles-v3-mayotte-z10-z14.mbtiles && \
\
cp ../bbox/reunion-z7-z14.bbox data/merge.bbox && \
sed -i 's/MIN_ZOOM.*/MIN_ZOOM=7/' .env && \
sed -i 's/MAX_ZOOM.*/MAX_ZOOM=14/' .env && \
make generate-tiles area=merge && \
mv data/tiles.mbtiles ../mbtiles/openmaptiles-v3-reunion-z7-z14.mbtiles && \
\
cp ../bbox/polynesie-z7-z14.bbox data/merge.bbox && \
sed -i 's/MIN_ZOOM.*/MIN_ZOOM=7/' .env && \
sed -i 's/MAX_ZOOM.*/MAX_ZOOM=14/' .env && \
make generate-tiles area=merge && \
mv data/tiles.mbtiles ../mbtiles/openmaptiles-v3-polynesie-z7-z14.mbtiles && \
\
cp ../bbox/guyane-z7-z9.bbox data/merge.bbox && \
sed -i 's/MIN_ZOOM.*/MIN_ZOOM=7/' .env && \
sed -i 's/MAX_ZOOM.*/MAX_ZOOM=9/' .env && \
make generate-tiles area=merge && \
mv data/tiles.mbtiles ../mbtiles/openmaptiles-v3-guyane-z7-z9.mbtiles && \
\
cp ../bbox/guyane-z10-z14.bbox data/merge.bbox && \
sed -i 's/MIN_ZOOM.*/MIN_ZOOM=10/' .env && \
sed -i 's/MAX_ZOOM.*/MAX_ZOOM=14/' .env && \
make generate-tiles area=merge
mv data/tiles.mbtiles ../mbtiles/openmaptiles-v3-guyane-z10-z14.mbtiles && \
\
cp ../bbox/madagascar-z7-z9.bbox data/merge.bbox && \
sed -i 's/MIN_ZOOM.*/MIN_ZOOM=7/' .env && \
sed -i 's/MAX_ZOOM.*/MAX_ZOOM=9/' .env && \
make generate-tiles area=merge && \
mv data/tiles.mbtiles ../mbtiles/openmaptiles-v3-madagascar-z7-z9.mbtiles && \
\
cp ../bbox/madagascar-z10-z14.bbox data/merge.bbox && \
sed -i 's/MIN_ZOOM.*/MIN_ZOOM=10/' .env && \
sed -i 's/MAX_ZOOM.*/MAX_ZOOM=14/' .env && \
make generate-tiles area=merge
mv data/tiles.mbtiles ../mbtiles/openmaptiles-v3-madagascar-z10-z14.mbtiles && \
\
cp ../bbox/europe-z7-z9.bbox data/merge.bbox && \
sed -i 's/MIN_ZOOM.*/MIN_ZOOM=7/' .env && \
sed -i 's/MAX_ZOOM.*/MAX_ZOOM=9/' .env && \
make generate-tiles area=merge && \
mv data/tiles.mbtiles ../mbtiles/openmaptiles-v3-europe-z7-z9.mbtiles && \
\
cp ../bbox/europe-z10-z14.bbox data/merge.bbox && \
sed -i 's/MIN_ZOOM.*/MIN_ZOOM=10/' .env && \
sed -i 's/MAX_ZOOM.*/MAX_ZOOM=14/' .env && \
make generate-tiles area=merge
mv data/tiles.mbtiles ../mbtiles/openmaptiles-v3-europe-z10-z14.mbtiles
cd ..
# 8m39,435s
docker-compose run --rm build bash -e -c "
cd /data/mbtiles
tile-join --no-tile-size-limit \
--attribution '<a href=\"https://www.teritorio.fr/\" target=\"_blank\">© Teritorio</a> <a href=\"https://www.openmaptiles.org/\" target=\"_blank\">© OpenMapTiles</a> <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">© OpenStreetMap contributors</a>' \
--force -o teritorio-dev.mbtiles \
openmaptiles-v3-z0-z6.mbtiles \
openmaptiles-v3-europe-z7-z9.mbtiles \
openmaptiles-v3-europe-z10-z14.mbtiles \
openmaptiles-v3-saint_pierre_et_miquelon-z7-z14.mbtiles \
openmaptiles-v3-antilles-z7-z14.mbtiles \
openmaptiles-v3-mayotte-z10-z14.mbtiles \
openmaptiles-v3-reunion-z7-z14.mbtiles \
openmaptiles-v3-polynesie-z7-z14.mbtiles \
openmaptiles-v3-guyane-z7-z9.mbtiles \
openmaptiles-v3-guyane-z10-z14.mbtiles \
openmaptiles-v3-madagascar-z7-z9.mbtiles \
openmaptiles-v3-madagascar-z10-z14.mbtiles
"
cp ontology-tourism.json ./mbtiles/teritorio-tourism-ontology-dev.json
cp ontology-city.json ./mbtiles/teritorio-city-ontology-dev.json