-
Notifications
You must be signed in to change notification settings - Fork 2
/
data.yml
780 lines (780 loc) · 24.9 KB
/
data.yml
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
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
_prefs:
disabled: []
inspector: false
mapid: ''
rev: ''
saveCenter: false
name: Meddo
description: Vector tiles for Wikipedia
attribution: 'Data © OpenStreetMap contributors'
center:
- 0
- 0
- 4
minzoom: 0
maxzoom: 16 # For development, otherwise 15
_parts:
osm2pgsql: &osm2pgsql
type: postgis
dbname: "ct"
srid: 3857
geometry_field: "way"
extent: "-20037508,-20037508,20037508,20037508"
Layer:
- id: water
geometry: polygon
description: Water polygons, including oceans
fields:
osm_id: &osm_id ID of the OSM object, if known. Negative for relations
properties:
minzoom: 0
buffer-size: 4
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
osm_id,
way
FROM water_areas
WHERE way_area > 0.05*!pixel_width!::real*!pixel_height!::real
AND z(!scale_denominator!) >= 5
UNION ALL
SELECT
NULL,
way
FROM ocean_polygons
WHERE z(!scale_denominator!) >= 10
UNION ALL
SELECT
NULL,
way
FROM simplified_ocean_polygons
WHERE z(!scale_denominator!) < 10 AND z(!scale_denominator!) >= 5
-- Switch to NE for very low zoom
UNION ALL
SELECT
NULL,
way
FROM ne_ocean
WHERE z(!scale_denominator!) < 5
UNION ALL
SELECT
NULL,
way
FROM ne_lake
WHERE z(!scale_denominator!) < 5
) AS water
- id: pier
geometry: polygon
description: Piers as areas and lines
fields:
osm_id: *osm_id
properties:
minzoom: 12
buffer-size: 4
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
osm_id,
way
FROM pier_area
-- WHERE way_area > 0.05*!pixel_width!::real*!pixel_height!::real
UNION ALL
SELECT
osm_id,
way
FROM pier_line
) AS pier
- id: waterway
geometry: linestring
description: Water lines
fields:
osm_id: &osm_id_norel ID of the OSM object, if known.
waterway: Type of waterway
properties:
minzoom: 6
buffer-size: 4
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
osm_id,
way,
waterway AS class
FROM waterways
WHERE waterway = 'river' AND z(!scale_denominator!) >= 8
OR waterway = 'canal' AND z(!scale_denominator!) >= 8
OR waterway = 'stream' AND z(!scale_denominator!) >= 12
OR waterway = 'drain' AND z(!scale_denominator!) >= 13
OR waterway = 'ditch' AND z(!scale_denominator!) >= 13
) AS waterway
- id: waterway_name
geometry: linestring
description: Names of water lines
fields:
osm_id: *osm_id_norel
name: &name Name of feature
name_: &name_ Names in other languages
waterway: Type of waterway
properties:
minzoom: 6
buffer-size: 4
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
osm_id,
way,
name,
(hstore_to_json(names))::text name_,
waterway AS class
FROM waterways
WHERE name IS NOT NULL AND
(waterway = 'river' AND z(!scale_denominator!) >= 8
OR waterway = 'canal' AND z(!scale_denominator!) >= 11
OR waterway = 'stream' AND z(!scale_denominator!) >= 12
OR waterway = 'drain' AND z(!scale_denominator!) >= 13
OR waterway = 'ditch' AND z(!scale_denominator!) >= 13)
) AS waterway
- id: boundary
geometry: linestring
description: Administrative boundaries
fields:
osm_id: *osm_id_norel
admin_level: Administrative level
disputed: If the boundary is disputed
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
osm_id,
way,
admin_level,
disputed
FROM osmborder_lines
WHERE (dividing_line OR disputed)
AND (admin_level <= 2
OR admin_level <= 4 AND z(!scale_denominator!) >= 3
OR admin_level <= 6 AND z(!scale_denominator!) >= 7
OR admin_level <= 8 AND z(!scale_denominator!) >= 10
OR z(!scale_denominator!) >= 14)
) AS boundary
properties:
minzoom: 2
- id: park
geometry: polygon
description: Protected area parks
fields:
osm_id: *osm_id
class: Type of protected area
properties:
minzoom: 8
buffer-size: 8
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
osm_id,
way,
class::text
FROM protected_area
) AS park
- id: building
geometry: polygon
description: Buildings
fields:
osm_id: *osm_id
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
osm_id,
way
FROM buildings
WHERE way_area > 0.05*!pixel_width!::real*!pixel_height!::real
ORDER BY way_area
) AS building
properties:
minzoom: 12
- id: transport
description: Transportation features
fields:
osm_id: *osm_id
class: &transport_class Class of feature
ramp: If the feature is a ramp
oneway: &oneway If the feature is oneway
brunnel: If the feature is a bridge or if it is a tunnel
layer: The layer for rendering order
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
osm_id,
way,
class::text,
ramp,
oneway,
brunnel::text,
layer
FROM
(SELECT
*
FROM
(SELECT
osm_id,
CASE WHEN oneway = 'reverse' THEN ST_Reverse(way) ELSE way END AS way,
class,
ramp,
oneway IN ('true','reverse') AS oneway,
brunnel,
layer,
NULL::real AS way_area
FROM roads
WHERE way && !bbox!
AND (
class >= 'motorway'
OR class >= 'trunk' AND z(!scale_denominator!) >= 7
OR class >= 'primary' AND z(!scale_denominator!) >= 8
OR class >= 'tertiary' AND z(!scale_denominator!) >= 9
OR class >= 'minor' AND z(!scale_denominator!) >= 13
OR class >= 'service' AND z(!scale_denominator!) >= 14
OR z(!scale_denominator!) >= 14
) AND NOT (ramp AND z(!scale_denominator!) < 11)
UNION ALL
SELECT
osm_id,
way,
class,
NULL::boolean AS ramp, -- cover ssy
NULL::boolean AS oneway,
brunnel,
layer,
NULL::real AS way_area
FROM rail
WHERE way && !bbox!
UNION ALL
SELECT
osm_id,
way,
class,
NULL::boolean AS ramp,
NULL::boolean AS oneway,
brunnel,
layer,
way_area
FROM road_areas
WHERE way && !bbox!
) AS t
ORDER BY layer, ramp DESC, class ASC, way_area DESC NULLS LAST
) AS typed_transport
) AS transport
properties:
minzoom: 6
- id: transport_name
description: Names of water lines
fields:
osm_id: *osm_id_norel
name: *name
name_: *name_
ref: The reference number of the feature
ref_length: The length of the ref field in characters
class: *transport_class
oneway: *oneway
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
osm_id,
way,
name,
(hstore_to_json(names))::text name_,
ref,
pg_catalog.char_length(ref) AS ref_length,
class::text,
oneway
FROM
(SELECT
*
FROM
(SELECT
osm_id,
CASE WHEN oneway = 'reverse' THEN ST_Reverse(way) ELSE way END AS way,
name,
names,
class,
oneway IN ('true','reverse') AS oneway,
pg_catalog.array_to_string(refs, ';') AS ref,
NULL::real AS way_area
FROM roads
WHERE way && !bbox!
AND (name IS NOT NULL OR refs IS NOT NULL)
AND (
class >= 'motorway'
OR class >= 'trunk' AND z(!scale_denominator!) >= 7
OR class >= 'primary' AND z(!scale_denominator!) >= 8
OR class >= 'tertiary' AND z(!scale_denominator!) >= 9
OR class >= 'minor' AND z(!scale_denominator!) >= 14
OR class >= 'service' AND z(!scale_denominator!) >= 14
OR z(!scale_denominator!) >= 14
)
) AS t
-- This sort needs to sort class reverse to the transport layer, where
-- high-class roads have to be rendered on top of everything else. Here
-- high-class roads need their labels placed first.
ORDER BY class DESC, way_area NULLS FIRST,
pg_catalog.length(name) DESC, name, osm_id
) AS typed_transport_name
) AS transport_name
properties:
minzoom: 6
buffer-size: 128
- id: aeroway
description: Features in aeroways
fields:
osm_id: *osm_id
class: *transport_class
ref: Reference of the feature
properties:
minzoom: 10
buffer-size: 8
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
osm_id,
way,
aeroway::text AS class,
ref
FROM aeroway_line
WHERE way && !bbox!
AND (aeroway = 'runway' AND z(!scale_denominator!) >= 10
OR aeroway = 'taxiway' AND z(!scale_denominator!) >= 12)
UNION ALL
SELECT
osm_id,
way,
aeroway::text AS class,
NULL::text AS ref
FROM aeroway_area
WHERE way && !bbox!
AND way_area > 0.05*!pixel_width!::real*!pixel_height!::real
AND z(!scale_denominator!) >= 12
) AS aeroway
- id: country_name
geometry: point
description: Features in aeroways
fields:
osm_id: *osm_id
name: *name
name_: *name_
way_pixels: &way_pixels Area of the feature, normalized to pixels at this zoom
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
osm_id,
ST_PointOnSurface(way) way,
name,
(hstore_to_json(names))::text name_,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels
FROM (
SELECT
*
FROM admin_area
WHERE way && !bbox!
AND ST_PointOnSurface(way) && !bbox!
AND name IS NOT NULL
AND level = 2
AND way_area > 1024*!pixel_width!::real*!pixel_height!::real
AND NOT (way_area > 256*256*9*!pixel_width!::real*!pixel_height!::real AND z(!scale_denominator!) >= 6) -- filter out large areas at higher zooms
ORDER BY level ASC,
way_area DESC
) admin_ordered
) AS state_name
properties:
minzoom: 2
buffer-size: 256
- id: place
description: Inhabited places
fields:
osm_id: &osm_id_node ID of OSM node, offset by 1E9
name: *name
name_: *name_
class: Class of feature
Datasource:
<<: *osm2pgsql
table: |-
(WITH osm_places AS ( -- Get all OSM data once, since it will be used in two parts of a UNION later
SELECT
node_id(osm_id) osm_id,
name,
names,
class,
rank,
population,
way,
NULL::real AS way_area
FROM place_point
WHERE way && !bbox!
AND name IS NOT NULL
AND (z(!scale_denominator!) < 8 AND rank >= 'town' AND class = 'settlement' -- For joining with NE data
OR z(!scale_denominator!) >= 8 AND rank >= 'city' AND class = 'settlement'
OR z(!scale_denominator!) >= 9 AND rank >= 'town' AND class = 'settlement'
OR z(!scale_denominator!) >= 10 AND rank >= 'village' AND class = 'settlement'
OR z(!scale_denominator!) >= 11 AND rank >= 'hamlet' AND class = 'settlement'
OR z(!scale_denominator!) >= 13 AND rank >= 'neighbourhood' AND class = 'subregion')
)
SELECT
osm_id,
way,
name,
(hstore_to_json(names))::text name_,
rank::text AS class, -- TODO: use a case statement to do this properly
NULL::bool AS capital,
NULL::int AS rank
FROM (
SELECT
*
FROM ( -- The places have an ORDER BY so need a subselect
SELECT
DISTINCT ON (ST_SnapToGrid(way, !pixel_width!::real*8, !pixel_height!::real*8))
osm_id,
way,
name,
names,
rank,
population
FROM osm_places
WHERE z(!scale_denominator!) >= 8 -- Only do this for z8+
ORDER BY
ST_SnapToGrid(way, !pixel_width!::real*8, !pixel_height!::real*8),
rank DESC NULLS LAST,
population DESC NULLS LAST,
pg_catalog.length(name) DESC,
name
) gridded_osm_places
ORDER BY
rank DESC NULLS LAST,
population DESC NULLS LAST,
pg_catalog.length(name) DESC,
name
) ordered_osm_places
UNION ALL
SELECT
osm_id,
way,
name,
(hstore_to_json(names))::text name_,
'city' AS class,
NULL::bool AS capital,
NULL::int AS rank
FROM (
SELECT
*
FROM ( -- this subselect gets NE place names and tries to join them against OSM place names
SELECT
DISTINCT ON (ne.ctid)
o.osm_id,
COALESCE(ST_PointOnSurface(o.way), ne.way) AS way,
COALESCE(o.name, ne.name) AS name,
o.names, -- Should get name:en from NE if no OSM match
labelrank,
scalerank,
natscale,
pop_max
FROM ne_places ne
LEFT JOIN osm_places o ON (
(pg_catalog.lower(unaccent(o.name)) IN (pg_catalog.lower(unaccent(ne.name)),
pg_catalog.lower(unaccent(ne.namepar)),
pg_catalog.lower(unaccent(ne.namealt)),
pg_catalog.lower(unaccent(ne.nameascii)))
OR pg_catalog.lower(unaccent(o.names->'en')) IN (pg_catalog.lower(unaccent(ne.name)),
pg_catalog.lower(unaccent(ne.namepar)),
pg_catalog.lower(unaccent(ne.namealt)),
pg_catalog.lower(unaccent(ne.nameascii))))
AND ST_DWithin(ne.way, o.way, 50000)
)
WHERE ne.way && !bbox!
AND z(!scale_denominator!) < 8 -- Use OSM for z8+
AND (z(!scale_denominator!) >= 7 AND scalerank < 7
OR z(!scale_denominator!) >= 6 AND scalerank < 6 -- NE has 4 and 5 the same
OR z(!scale_denominator!) >= 5 AND scalerank < 4
OR z(!scale_denominator!) >= 4 AND scalerank < 3
OR z(!scale_denominator!) >= 3 AND scalerank < 2)
ORDER BY -- this order by determines the "best" OSM match.
ne.ctid,
levenshtein(pg_catalog.lower(unaccent(o.name)), pg_catalog.lower(unaccent(ne.name))) ASC,
ST_Distance(o.way, ne.way)
) ne_places
ORDER BY -- Set the order in terms of NE paramaters
labelrank ASC,
scalerank ASC,
natscale DESC,
pop_max DESC,
name
) ne_ordered
) AS place
properties:
minzoom: 2
buffer-size: 256
- id: state_name
geometry: point
description: State names
fields:
osm_id: *osm_id
name: *name
name_: *name_
way_pixels: *way_pixels
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
osm_id,
ST_PointOnSurface(way) way,
name,
(hstore_to_json(names))::text name_,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels
FROM (
SELECT
*
FROM admin_area
WHERE way && !bbox!
AND ST_PointOnSurface(way) && !bbox!
AND name IS NOT NULL
AND level = 4
AND way_area > 1024*!pixel_width!::real*!pixel_height!::real
AND NOT (way_area > 256*256*9*!pixel_width!::real*!pixel_height!::real AND z(!scale_denominator!) >= 6) -- filter out large areas at higher zooms
ORDER BY level ASC,
way_area DESC
) admin_ordered
) AS state_name
properties:
minzoom: 4
buffer-size: 256
- id: landcover
geometry: polygon
description: Land coverings and other areas used for fills
fields:
osm_id: *osm_id
class: Type of use
properties:
minzoom: 7
buffer-size: 4
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
osm_id,
way,
class
FROM (SELECT
osm_id,
way,
'wood' AS class,
20 AS prio,
way_area
FROM wood_area
WHERE way_area > 0.05*!pixel_width!::real*!pixel_height!::real
AND z(!scale_denominator!) >= 7
UNION ALL
SELECT
osm_id,
way,
'park' AS class,
10 AS prio,
way_area
FROM recreation_polygon
WHERE way_area > 0.05*!pixel_width!::real*!pixel_height!::real
AND z(!scale_denominator!) >= 11
AND recreation IN ('park', 'dog_park', 'garden', 'golf')
) AS features
ORDER BY
prio ASC,
way_area DESC
) AS landcover
- id: landuse
geometry: polygon
descriptions: Landuses
fields:
osm_id: *osm_id
class: Class of feature
properties:
minzoom: 12
buffer-size: 4
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
osm_id,
way,
class
FROM (
SELECT
osm_id,
way,
'hospital' AS class,
20 as prio,
way_area
FROM healthcare_polygon
WHERE way_area > 0.05*!pixel_width!::real*!pixel_height!::real
AND healthcare = 'hospital'
AND z(!scale_denominator!) >= 12
UNION ALL
SELECT
osm_id,
way,
education::text AS class,
10 as prio,
way_area
FROM education_polygon
WHERE way_area > 0.05*!pixel_width!::real*!pixel_height!::real
AND (education = 'school' AND z(!scale_denominator!) >= 13
OR education = 'university' AND z(!scale_denominator!) >= 11
OR education = 'kindergarten' AND z(!scale_denominator!) >= 14
OR education = 'college' AND z(!scale_denominator!) >= 11
OR education = 'library' AND z(!scale_denominator!) >= 14)
UNION ALL
SELECT
osm_id,
way,
landuse::text AS class,
100 as prio,
way_area
FROM landuse
WHERE way_area > 0.05*!pixel_width!::real*!pixel_height!::real
AND landuse IN ('residential', 'industrial', 'commercial', 'retail', 'cemetery')
AND z(!scale_denominator!) >= 12
) AS features
ORDER BY
prio DESC,
way_area DESC
) AS landuse
- id: landcover_name
geometry: point
description: Names of landcover areas
fields:
osm_id: *osm_id
name: *name
name_: *name_
class: Class of feature
properties:
minzoom: 5
buffer-size: 128
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
osm_id,
ST_PointOnSurface(way) AS way,
class,
name,
(hstore_to_json(names))::text name_
FROM (
SELECT
osm_id,
way,
name,
names,
landuse::text AS class,
100 as prio,
way_area
FROM landuse
WHERE landuse IN ('residential', 'industrial', 'railway', 'commercial', 'retail', 'cemetery')
AND z(!scale_denominator!) >= 12
UNION ALL
SELECT
osm_id,
way,
name,
names,
class::text,
50 as prio,
way_area
FROM protected_area
WHERE z(!scale_denominator!) >= 8
UNION ALL
SELECT
osm_id,
way,
name,
names,
'water' AS class,
40 as prio,
way_area
FROM water_areas
WHERE z(!scale_denominator!) >= 5
AND water != 'river' -- Exclude rivers, which are better labeled with their centerline
) AS features
WHERE way && !bbox!
AND ST_PointOnSurface(way) && !bbox!
AND (way_area > 256*256*0.1*!pixel_width!::real*!pixel_height!::real OR way_area > 1024*!pixel_width!::real*!pixel_height!::real AND z(!scale_denominator!) >= 15)
AND NOT (way_area > 256*256*9*!pixel_width!::real*!pixel_height!::real AND z(!scale_denominator!) >= 6) -- filter out large areas at higher zooms
AND (name IS NOT NULL OR names IS NOT NULL)
ORDER BY
prio DESC,
way_area DESC
) AS landuse_name
- id: transit_stop
geometry: point
description: Transit stops
fields:
osm_id: *osm_id
name: *name
name_: *name_
mode: Mode of transit
station: If the point is a station or a stop
properties:
minzoom: 15
buffer-size: 128
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
osm_id,
way,
name,
(hstore_to_json(names))::text name_,
transit_mode::text AS "mode",
station
FROM (
SELECT
osm_id,
way,
name,
names,
transit_mode,
station,
NULL::real AS way_area
FROM transit_point
UNION ALL
SELECT
osm_id,
ST_PointOnSurface(way) AS way,
name,
names,
transit_mode,
station,
way_area
FROM transit_polygon
WHERE way && !bbox!
) AS features
WHERE way && !bbox!
AND (transit_mode = 'ferry' AND z(!scale_denominator!) >= 15
OR transit_mode = 'rail' AND z(!scale_denominator!) >= 15
OR transit_mode = 'tram' AND z(!scale_denominator!) >= 15
OR transit_mode = 'bus' AND station AND z(!scale_denominator!) >= 15
OR transit_mode = 'bus' AND NOT station AND z(!scale_denominator!) >= 15
OR transit_mode = 'taxi' AND z(!scale_denominator!) >= 15)
ORDER BY
station DESC,
CASE
WHEN transit_mode = 'ferry' THEN 1
WHEN transit_mode = 'rail' THEN 2
WHEN transit_mode = 'tram' THEN 3
WHEN transit_mode = 'taxi' THEN 4
WHEN transit_mode = 'bus' THEN 5
ELSE NULL END,
way_area DESC NULLS LAST,
osm_id
) AS transit_stop