-
Notifications
You must be signed in to change notification settings - Fork 120
/
queries.yaml
457 lines (457 loc) · 17 KB
/
queries.yaml
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
all:
- water
- earth
- places
- landuse
- roads
- buildings
- pois
- boundaries
- transit
layers:
water:
template: water.jinja2
start_zoom: 0
geometry_types: [Point, MultiPoint, Polygon, MultiPolygon, LineString, MultiLineString]
simplify_before_intersect: true
simplify_start: 9
transform:
- TileStache.Goodies.VecTiles.transform.tags_create_dict
- TileStache.Goodies.VecTiles.transform.tags_name_i18n
- TileStache.Goodies.VecTiles.transform.tags_remove
- TileStache.Goodies.VecTiles.transform.water_tunnel
- TileStache.Goodies.VecTiles.transform.add_id_to_properties
- TileStache.Goodies.VecTiles.transform.detect_osm_relation
- TileStache.Goodies.VecTiles.transform.remove_feature_id
sort: TileStache.Goodies.VecTiles.sort.water
earth:
template: earth.jinja2
start_zoom: 0
geometry_types: [Point, MultiPoint, Polygon, MultiPolygon, LineString, MultiLineString]
simplify_before_intersect: true
simplify_start: 9
transform:
- TileStache.Goodies.VecTiles.transform.tags_create_dict
- TileStache.Goodies.VecTiles.transform.tags_name_i18n
- TileStache.Goodies.VecTiles.transform.tags_remove
- TileStache.Goodies.VecTiles.transform.detect_osm_relation
- TileStache.Goodies.VecTiles.transform.add_id_to_properties
- TileStache.Goodies.VecTiles.transform.remove_feature_id
sort: TileStache.Goodies.VecTiles.sort.earth
places:
template: places.jinja2
start_zoom: 0
geometry_types: [Point, MultiPoint]
transform:
- TileStache.Goodies.VecTiles.transform.tags_create_dict
- TileStache.Goodies.VecTiles.transform.tags_name_i18n
- TileStache.Goodies.VecTiles.transform.tags_remove
- TileStache.Goodies.VecTiles.transform.place_ne_capital
- TileStache.Goodies.VecTiles.transform.place_population_int
- TileStache.Goodies.VecTiles.transform.calculate_default_place_scalerank
- TileStache.Goodies.VecTiles.transform.add_id_to_properties
- TileStache.Goodies.VecTiles.transform.detect_osm_relation
- TileStache.Goodies.VecTiles.transform.remove_feature_id
sort: TileStache.Goodies.VecTiles.sort.places
landuse:
template: landuse.jinja2
start_zoom: 4
geometry_types: [Polygon, MultiPolygon, LineString, MultiLineString]
simplify_start: 4
transform:
- TileStache.Goodies.VecTiles.transform.tags_create_dict
- TileStache.Goodies.VecTiles.transform.tags_name_i18n
- TileStache.Goodies.VecTiles.transform.tags_remove
- TileStache.Goodies.VecTiles.transform.normalize_tourism_kind
- TileStache.Goodies.VecTiles.transform.add_id_to_properties
- TileStache.Goodies.VecTiles.transform.detect_osm_relation
- TileStache.Goodies.VecTiles.transform.remove_feature_id
sort: TileStache.Goodies.VecTiles.sort.landuse
roads:
template: roads.jinja2
start_zoom: 5
geometry_types: [LineString, MultiLineString]
simplify_start: 8
transform:
- TileStache.Goodies.VecTiles.transform.tags_create_dict
- TileStache.Goodies.VecTiles.transform.tags_name_i18n
- TileStache.Goodies.VecTiles.transform.add_id_to_properties
- TileStache.Goodies.VecTiles.transform.detect_osm_relation
- TileStache.Goodies.VecTiles.transform.parse_layer_as_float
- TileStache.Goodies.VecTiles.transform.road_classifier
- TileStache.Goodies.VecTiles.transform.road_oneway
- TileStache.Goodies.VecTiles.transform.road_abbreviate_name
- TileStache.Goodies.VecTiles.transform.route_name
- TileStache.Goodies.VecTiles.transform.normalize_aerialways
- TileStache.Goodies.VecTiles.transform.road_trim_properties
- TileStache.Goodies.VecTiles.transform.remove_feature_id
- TileStache.Goodies.VecTiles.transform.tags_remove
sort: TileStache.Goodies.VecTiles.sort.roads
buildings:
template: buildings.jinja2
start_zoom: 13
clip_factor: 3.0
geometry_types: [Point, MultiPoint, Polygon, MultiPolygon]
transform:
- TileStache.Goodies.VecTiles.transform.tags_create_dict
- TileStache.Goodies.VecTiles.transform.tags_name_i18n
- TileStache.Goodies.VecTiles.transform.tags_remove
- TileStache.Goodies.VecTiles.transform.add_id_to_properties
- TileStache.Goodies.VecTiles.transform.detect_osm_relation
- TileStache.Goodies.VecTiles.transform.parse_layer_as_float
- TileStache.Goodies.VecTiles.transform.building_height
- TileStache.Goodies.VecTiles.transform.building_min_height
- TileStache.Goodies.VecTiles.transform.synthesize_volume
- TileStache.Goodies.VecTiles.transform.normalize_tourism_kind
- TileStache.Goodies.VecTiles.transform.building_trim_properties
- TileStache.Goodies.VecTiles.transform.remove_feature_id
sort: TileStache.Goodies.VecTiles.sort.buildings
pois:
template: pois.jinja2
start_zoom: 9
geometry_types: [Point, MultiPoint, Polygon, MultiPolygon]
transform:
- TileStache.Goodies.VecTiles.transform.tags_create_dict
- TileStache.Goodies.VecTiles.transform.add_iata_code_to_airports
- TileStache.Goodies.VecTiles.transform.normalize_leisure_kind
- TileStache.Goodies.VecTiles.transform.normalize_tourism_kind
- TileStache.Goodies.VecTiles.transform.normalize_social_kind
- TileStache.Goodies.VecTiles.transform.normalize_medical_kind
- TileStache.Goodies.VecTiles.transform.add_state_to_stations
- TileStache.Goodies.VecTiles.transform.tags_name_i18n
- TileStache.Goodies.VecTiles.transform.add_uic_ref
- TileStache.Goodies.VecTiles.transform.tags_remove
- TileStache.Goodies.VecTiles.transform.add_id_to_properties
- TileStache.Goodies.VecTiles.transform.detect_osm_relation
- TileStache.Goodies.VecTiles.transform.remove_feature_id
- TileStache.Goodies.VecTiles.transform.remove_zero_area
- TileStache.Goodies.VecTiles.transform.pois_kind_aeroway_gate
- TileStache.Goodies.VecTiles.transform.make_representative_point
- TileStache.Goodies.VecTiles.transform.height_to_meters
- TileStache.Goodies.VecTiles.transform.pois_capacity_int
- TileStache.Goodies.VecTiles.transform.elevation_to_meters
sort: TileStache.Goodies.VecTiles.sort.pois
boundaries:
template: boundaries.jinja2
start_zoom: 0
geometry_types: [Polygon, MultiPolygon, LineString, MultiLineString]
simplify_before_intersect: true
simplify_start: 8
transform:
- TileStache.Goodies.VecTiles.transform.tags_create_dict
- TileStache.Goodies.VecTiles.transform.tags_name_i18n
- TileStache.Goodies.VecTiles.transform.tags_remove
- TileStache.Goodies.VecTiles.transform.admin_level_as_int
- TileStache.Goodies.VecTiles.transform.add_id_to_properties
- TileStache.Goodies.VecTiles.transform.detect_osm_relation
- TileStache.Goodies.VecTiles.transform.remove_feature_id
transit:
template: transit.jinja2
start_zoom: 5
geometry_types: [LineString, MultiLineString, Polygon, MultiPolygon]
transform:
- TileStache.Goodies.VecTiles.transform.tags_create_dict
- TileStache.Goodies.VecTiles.transform.tags_name_i18n
- TileStache.Goodies.VecTiles.transform.add_uic_ref
- TileStache.Goodies.VecTiles.transform.tags_remove
- TileStache.Goodies.VecTiles.transform.add_id_to_properties
- TileStache.Goodies.VecTiles.transform.detect_osm_relation
- TileStache.Goodies.VecTiles.transform.route_name
- TileStache.Goodies.VecTiles.transform.parse_layer_as_float
- TileStache.Goodies.VecTiles.transform.remove_feature_id
sort: TileStache.Goodies.VecTiles.sort.transit
post_process:
- fn: TileStache.Goodies.VecTiles.transform.csv_match_properties
resources:
matcher:
type: file
init_fn: TileStache.Goodies.VecTiles.transform.CSVMatcher
path: spreadsheets/landuse.csv
params:
source_layer: landuse
target_value_type: int
- fn: TileStache.Goodies.VecTiles.transform.csv_match_properties
resources:
matcher:
type: file
init_fn: TileStache.Goodies.VecTiles.transform.CSVMatcher
path: spreadsheets/roads.csv
params:
source_layer: roads
target_value_type: int
- fn: TileStache.Goodies.VecTiles.transform.csv_match_properties
resources:
matcher:
type: file
init_fn: TileStache.Goodies.VecTiles.transform.CSVMatcher
path: spreadsheets/earth.csv
params:
source_layer: earth
target_value_type: int
- fn: TileStache.Goodies.VecTiles.transform.csv_match_properties
resources:
matcher:
type: file
init_fn: TileStache.Goodies.VecTiles.transform.CSVMatcher
path: spreadsheets/boundaries.csv
params:
source_layer: boundaries
target_value_type: int
- fn: TileStache.Goodies.VecTiles.transform.csv_match_properties
resources:
matcher:
type: file
init_fn: TileStache.Goodies.VecTiles.transform.CSVMatcher
path: spreadsheets/buildings.csv
params:
source_layer: buildings
target_value_type: int
- fn: TileStache.Goodies.VecTiles.transform.csv_match_properties
resources:
matcher:
type: file
init_fn: TileStache.Goodies.VecTiles.transform.CSVMatcher
path: spreadsheets/transit.csv
params:
source_layer: transit
target_value_type: int
- fn: TileStache.Goodies.VecTiles.transform.drop_properties
params:
source_layer: roads
properties: [layer]
- fn: TileStache.Goodies.VecTiles.transform.numeric_min_filter
params:
source_layer: buildings
mode: any
filters:
13: { area: 1600, volume: 300000 }
14: { area: 100, volume: 200000 }
15: { area: 100, volume: 100000 }
- fn: TileStache.Goodies.VecTiles.transform.intercut
params:
base_layer: roads
cutting_layer: landuse
attribute: kind
target_attribute: landuse_kind
cutting_attrs: { sort_key: 'sort_key', reverse: True }
- fn: TileStache.Goodies.VecTiles.transform.exterior_boundaries
params:
base_layer: water
start_zoom: 9
prop_transform:
kind: true
id: true
source: true
boundary: "yes"
area: true
snap_tolerance: 0.125
# have to do the water properties matching _after_ exterior boundaries
# as it depends on having the "boundary: yes" property available.
- fn: TileStache.Goodies.VecTiles.transform.csv_match_properties
resources:
matcher:
type: file
init_fn: TileStache.Goodies.VecTiles.transform.CSVMatcher
path: spreadsheets/water.csv
params:
source_layer: water
target_value_type: int
- fn: TileStache.Goodies.VecTiles.transform.overlap
params:
base_layer: buildings
cutting_layer: landuse
attribute: kind
target_attribute: landuse_kind
cutting_attrs: { sort_key: 'sort_key', reverse: True }
- fn: TileStache.Goodies.VecTiles.transform.admin_boundaries
params:
base_layer: boundaries
start_zoom: 8
- fn: TileStache.Goodies.VecTiles.transform.generate_label_features
params:
source_layer: landuse
label_property_name: label_placement
label_property_value: "yes"
drop_keys: [ mz_is_building ]
- fn: TileStache.Goodies.VecTiles.transform.remove_duplicate_features
params:
source_layer: landuse
property_keys: [name, kind]
geometry_types: [Point]
min_distance: 256.0
- fn: TileStache.Goodies.VecTiles.transform.generate_label_features
params:
source_layer: water
label_property_name: label_placement
label_property_value: "yes"
- fn: TileStache.Goodies.VecTiles.transform.drop_features_where
params:
source_layer: water
start_zoom: 9
where: >-
'label_placement' not in properties and kind in ('bay', 'strait', 'fjord')
- fn: TileStache.Goodies.VecTiles.transform.generate_label_features
params:
source_layer: earth
label_property_name: label_placement
label_property_value: "yes"
- fn: TileStache.Goodies.VecTiles.transform.drop_features_where
params:
source_layer: earth
start_zoom: 9
where: >-
'label_placement' not in properties and kind in ('archipelago', 'island', 'islet')
- fn: TileStache.Goodies.VecTiles.transform.generate_address_points
params:
source_layer: buildings
start_zoom: 16
- fn: TileStache.Goodies.VecTiles.transform.generate_label_features
params:
source_layer: buildings
label_property_name: label_placement
label_property_value: "yes"
- fn: TileStache.Goodies.VecTiles.transform.remove_duplicate_features
params:
source_layer: buildings
property_keys: [name, kind]
geometry_types: [Point]
min_distance: 256.0
- fn: TileStache.Goodies.VecTiles.transform.remove_duplicate_features
params:
source_layer: pois
property_keys: [name, kind]
geometry_types: [Point]
min_distance: 256.0
- fn: TileStache.Goodies.VecTiles.transform.drop_features_where
params:
source_layer: landuse
start_zoom: 13
where: >-
properties.get('mz_is_building') is True
- fn: TileStache.Goodies.VecTiles.transform.drop_properties
params:
source_layer: landuse
start_zoom: 13
properties: [mz_is_building]
- fn: TileStache.Goodies.VecTiles.transform.merge_duplicate_stations
params:
source_layer: pois
end_zoom: 15
- fn: TileStache.Goodies.VecTiles.transform.normalize_station_properties
params:
source_layer: pois
- fn: TileStache.Goodies.VecTiles.transform.rank_features
params:
source_layer: pois
items_matching:
kind: station
rank_key: kind_tile_rank
- fn: TileStache.Goodies.VecTiles.transform.rank_features
params:
source_layer: places
items_matching:
kind: [neighbourhood, microhood, macrohood]
rank_key: kind_tile_rank
start_zoom: 11
- fn: TileStache.Goodies.VecTiles.transform.drop_properties
params:
source_layer: places
properties: [mz_n_photos]
start_zoom: 11
- fn: TileStache.Goodies.VecTiles.transform.remove_duplicate_features
params:
source_layers: [pois, landuse, buildings]
property_keys: [name]
geometry_types: [Point]
min_distance: 64.0
- fn: TileStache.Goodies.VecTiles.transform.copy_features
params:
source_layer: landuse
target_layer: landuse_labels
where:
label_placement: yes
geometry_types: [Point]
- fn: TileStache.Goodies.VecTiles.transform.drop_properties
params:
source_layer: roads
start_zoom: 0
end_zoom: 14
properties: [is_bridge, is_tunnel]
where: >-
(kind == 'path' and zoom < 15) or
(kind in ['minor_road', 'major_road', 'highway', 'rail'] and zoom < 13)
# drop all oneway tags below zoom 14 (i.e: zoom >= 15) for all types.
- fn: TileStache.Goodies.VecTiles.transform.drop_properties
params:
source_layer: roads
start_zoom: 0
end_zoom: 14
properties: [oneway]
- fn: TileStache.Goodies.VecTiles.transform.drop_properties
params:
source_layer: roads
start_zoom: 0
end_zoom: 16
properties: [name, ref, network]
where: >-
(kind == 'rail' and zoom < 15) or
(kind == 'minor_road' and zoom < 14) or
(kind == 'major_road' and zoom < 7) or
(kind == 'highway' and zoom < 7)
# this is a patch because we still want to drop name, network from major_road
# features between zoom 7 and 10
- fn: TileStache.Goodies.VecTiles.transform.drop_properties
params:
source_layer: roads
start_zoom: 7
end_zoom: 10
properties: [name, network]
where: >-
kind == 'major_road'
# this is a patch to get rid of name, but keep ref & network, for highways
# when zoom < 11.
- fn: TileStache.Goodies.VecTiles.transform.drop_properties
params:
source_layer: roads
start_zoom: 7
end_zoom: 10
properties: [name]
where: >-
kind == 'highway'
- fn: TileStache.Goodies.VecTiles.transform.merge_features
params:
source_layer: roads
start_zoom: 8
end_zoom: 16
- fn: TileStache.Goodies.VecTiles.transform.update_parenthetical_properties
params:
source_layer: pois
values: ['closed', 'historical']
target_min_zoom: 17
drop_below_zoom: 16
- fn: TileStache.Goodies.VecTiles.transform.update_parenthetical_properties
params:
source_layer: buildings
values: ['closed', 'historical']
target_min_zoom: 17
drop_below_zoom: 16
- fn: TileStache.Goodies.VecTiles.transform.merge_features
params:
source_layer: transit
start_zoom: 0
end_zoom: 15
# only keep all stations below z12, then cut it down to the top few.
- fn: TileStache.Goodies.VecTiles.transform.keep_n_features
params:
source_layer: transit
start_zoom: 9
end_zoom: 11
items_matching: { kind: station }
max_items: 20
- fn: TileStache.Goodies.VecTiles.transform.keep_n_features
params:
source_layer: transit
start_zoom: 12
end_zoom: 13
items_matching: { kind: station }
max_items: 30