-
Notifications
You must be signed in to change notification settings - Fork 2
/
data.xml
804 lines (771 loc) · 38.4 KB
/
data.xml
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
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map[]>
<Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<Parameters>
<Parameter name="center">37.7731,-4.2957,6</Parameter>
<Parameter name="format">pbf</Parameter>
<Parameter name="json"><![CDATA[{"vector_layers":[{"id":"landuse","description":"","fields":{"osm_id":"Number","class":"String"}},{"id":"water","description":"","fields":{"osm_id":"Number"}},{"id":"waterway","description":"","fields":{"osm_id":"Number","type":"String","class":"String"}},{"id":"landuse_overlay","description":"","fields":{"osm_id":"Number","class":"String"}},{"id":"road","description":"","fields":{"osm_id":"Number","oneway":"Number","type":"String","class":"String"}},{"id":"bridge","description":"","fields":{"osm_id":"Number","oneway":"Number","layer":"Number","type":"String","class":"String"}},{"id":"tunnel","description":"","fields":{"osm_id":"Number","oneway":"Number","layer":"Number","type":"String","class":"String"}},{"id":"admin","description":"osm_tanzania","fields":{"osm_id":"Number","admin_level":"Number","disputed":"Number","maritime":"Number"}},{"id":"country_label","description":"","fields":{"osm_id":"Number","name":"String","name_en":"String","rank":"Number"}},{"id":"state_label","description":"","fields":{"osm_id":"Number","name":"String","name_en":"String","area":"Number"}},{"id":"place_label","description":"","fields":{"osm_id":"Number","name":"String","name_en":"String","type":"String","capital":"Number","ldir":"String","localrank":"Number","scalerank":"Number"}},{"id":"road_label","description":"","fields":{"osm_id":"Number","name":"String","name_en":"String","ref":"String","reflen":"Number","len":"Number","class":"String"}},{"id":"waterway_label","description":"","fields":{"osm_id":"Number","name":"String","name_en":"String","type":"String","class":"String"}},{"id":"water_label","description":"","fields":{"osm_id":"Number","name":"String","name_en":"String","area":"Number"}},{"id":"poi_label","description":"","fields":{"osm_id":"Number","name":"String","name_en":"String","type":"String","scalerank":"Number","localrank":"Number","maki":"String"}}]}]]></Parameter>
<Parameter name="maxzoom">16</Parameter>
<Parameter name="minzoom">0</Parameter>
</Parameters>
<Layer name="landuse"
buffer-size="8"
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<Datasource>
<Parameter name="dbname"><![CDATA[osm_tanzania]]></Parameter>
<Parameter name="extent"><![CDATA[-20037508.34,-20037508.34,20037508.34,20037508.34]]></Parameter>
<Parameter name="geometry_field"><![CDATA[]]></Parameter>
<Parameter name="geometry_table"><![CDATA[]]></Parameter>
<Parameter name="host"><![CDATA[localhost]]></Parameter>
<Parameter name="key_field"><![CDATA[]]></Parameter>
<Parameter name="max_size"><![CDATA[512]]></Parameter>
<Parameter name="password"><![CDATA[postgres]]></Parameter>
<Parameter name="port"><![CDATA[5432]]></Parameter>
<Parameter name="table"><![CDATA[(
select geometry, osm_id, 'agriculture' as class from osm_landusages
where type in ('farmland', 'farm', 'farmyard', 'orchard',
'vineyard', 'plant_nursery')
and z(!scale_denominator!) >= 10
union all
select geometry, osm_id, 'cemetery' as class from osm_landusages
where type in ('cemetery')
and z(!scale_denominator!) >= 10
union all
select geometry, osm_id, 'glacier' as class from osm_landusages
where type in ('glacier')
and z(!scale_denominator!) >= 10
union all
select geometry, osm_id, 'grass' as class from osm_landusages
where type in ('grass', 'grassland', 'meadow', 'field')
and z(!scale_denominator!) >= 10
union all
select geometry, osm_id, 'hospital' as class from osm_landusages
where type in ('hospital')
and z(!scale_denominator!) >= 10
union all
select geometry, osm_id, 'industrial' as class from osm_landusages
where type in ('industrial', 'airport')
and z(!scale_denominator!) >= 10
union all
select geometry, osm_id, 'park' as class from osm_landusages
where type in (
'nature_reserve', 'national_reserve', 'conservation',
'national_park')
and z(!scale_denominator!) >= 7
union all
select geometry, osm_id, 'park' as class from osm_landusages
where type in ('park', 'village_green', 'playground')
and z(!scale_denominator!) >= 10
union all
select geometry, osm_id, 'pitch' as class from osm_landusages
where type in ('pitch', 'golf_course', 'recreation_ground', 'stadium')
and z(!scale_denominator!) >= 10
union all
select geometry, osm_id, 'rock' as class from osm_landusages
where type in ('rock', 'scree', 'quarry')
and z(!scale_denominator!) >= 10
union all
select geometry, osm_id, 'sand' as class from osm_landusages
where type in ('sand', 'beach', 'dune')
and z(!scale_denominator!) >= 10
union all
select geometry, osm_id, 'school' as class from osm_landusages
where type in ('school', 'university')
and z(!scale_denominator!) >= 10
union all
select geometry, osm_id, 'scrub' as class from osm_landusages
where type in ('scrub', 'heath', 'bush')
and z(!scale_denominator!) >= 10
union all
select geometry, osm_id, 'wood' as class from osm_landusages
where type in ('wood', 'forest')
and z(!scale_denominator!) >= 7
) AS data]]></Parameter>
<Parameter name="type"><![CDATA[postgis]]></Parameter>
<Parameter name="user"><![CDATA[postgres]]></Parameter>
</Datasource>
</Layer>
<Layer name="water"
buffer-size="8"
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<Datasource>
<Parameter name="dbname"><![CDATA[osm_tanzania]]></Parameter>
<Parameter name="extent"><![CDATA[-20037508.34,-20037508.34,20037508.34,20037508.34]]></Parameter>
<Parameter name="geometry_field"><![CDATA[]]></Parameter>
<Parameter name="geometry_table"><![CDATA[]]></Parameter>
<Parameter name="host"><![CDATA[localhost]]></Parameter>
<Parameter name="key_field"><![CDATA[]]></Parameter>
<Parameter name="max_size"><![CDATA[512]]></Parameter>
<Parameter name="password"><![CDATA[postgres]]></Parameter>
<Parameter name="port"><![CDATA[5432]]></Parameter>
<Parameter name="table"><![CDATA[(
select geometry, osm_id from osm_waterareas
where st_area(geometry) >= 5000000000
union all
select geometry, osm_id from osm_waterareas
where st_area(geometry) < 5000000000 and st_area(geometry) >= 1500000000
and z(!scale_denominator!) >= 2
union all
select geometry, osm_id from osm_waterareas
where st_area(geometry) < 1500000000 and st_area(geometry) >= 500000000
and z(!scale_denominator!) >= 5
union all
select geometry, osm_id from osm_waterareas
where st_area(geometry) < 500000000 and st_area(geometry) >= 100000000
and z(!scale_denominator!) >= 6
union all
select geometry, osm_id from osm_waterareas
where st_area(geometry) < 100000000 and st_area(geometry) >= 40000000
and z(!scale_denominator!) >= 7
union all
select geometry, osm_id from osm_waterareas
where st_area(geometry) < 40000000 and st_area(geometry) >= 20000000
and z(!scale_denominator!) >= 8
union all
select geometry, osm_id from osm_waterareas
where st_area(geometry) < 20000000 and st_area(geometry) >= 10000000
and z(!scale_denominator!) >= 9
union all
select geometry, osm_id from osm_waterareas
where st_area(geometry) < 10000000
and z(!scale_denominator!) >= 10
) AS data]]></Parameter>
<Parameter name="type"><![CDATA[postgis]]></Parameter>
<Parameter name="user"><![CDATA[postgres]]></Parameter>
</Datasource>
</Layer>
<Layer name="waterway"
buffer-size="8"
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<Datasource>
<Parameter name="dbname"><![CDATA[osm_tanzania]]></Parameter>
<Parameter name="extent"><![CDATA[-20037508.34,-20037508.34,20037508.34,20037508.34]]></Parameter>
<Parameter name="geometry_field"><![CDATA[]]></Parameter>
<Parameter name="geometry_table"><![CDATA[]]></Parameter>
<Parameter name="host"><![CDATA[localhost]]></Parameter>
<Parameter name="key_field"><![CDATA[]]></Parameter>
<Parameter name="max_size"><![CDATA[512]]></Parameter>
<Parameter name="password"><![CDATA[postgres]]></Parameter>
<Parameter name="port"><![CDATA[5432]]></Parameter>
<Parameter name="table"><![CDATA[(
select geometry, osm_id, type, type as class from osm_waterways
where type in ('river', 'canal')
and z(!scale_denominator!) >= 8
union all
select geometry, osm_id, type, type as class from osm_waterways
where type in ('stream', 'stream_intermittent')
and z(!scale_denominator!) >= 13
union all
select geometry, osm_id, type, type as class from osm_waterways
where type in ('drain', 'ditch')
and z(!scale_denominator!) >= 15
) AS data]]></Parameter>
<Parameter name="type"><![CDATA[postgis]]></Parameter>
<Parameter name="user"><![CDATA[postgres]]></Parameter>
</Datasource>
</Layer>
<Layer name="landuse_overlay"
buffer-size="8"
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<Datasource>
<Parameter name="dbname"><![CDATA[osm_tanzania]]></Parameter>
<Parameter name="extent"><![CDATA[-20037508.34,-20037508.34,20037508.34,20037508.34]]></Parameter>
<Parameter name="geometry_field"><![CDATA[]]></Parameter>
<Parameter name="geometry_table"><![CDATA[]]></Parameter>
<Parameter name="host"><![CDATA[localhost]]></Parameter>
<Parameter name="key_field"><![CDATA[]]></Parameter>
<Parameter name="max_size"><![CDATA[512]]></Parameter>
<Parameter name="password"><![CDATA[postgres]]></Parameter>
<Parameter name="port"><![CDATA[5432]]></Parameter>
<Parameter name="table"><![CDATA[(
select geometry, osm_id, 'wetland' as class from osm_landusages
where type in ('wetland', 'marsh', 'swamp')
and z(!scale_denominator!) >= 10
union all
select geometry, osm_id, 'wetland_noveg' as class from osm_landusages
where type in ('mud', 'tidalflat')
and z(!scale_denominator!) >= 10
) AS data]]></Parameter>
<Parameter name="type"><![CDATA[postgis]]></Parameter>
<Parameter name="user"><![CDATA[postgres]]></Parameter>
</Datasource>
</Layer>
<Layer name="road"
buffer-size="8"
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<Datasource>
<Parameter name="dbname"><![CDATA[osm_tanzania]]></Parameter>
<Parameter name="extent"><![CDATA[-20037508.34,-20037508.34,20037508.34,20037508.34]]></Parameter>
<Parameter name="geometry_field"><![CDATA[]]></Parameter>
<Parameter name="geometry_table"><![CDATA[]]></Parameter>
<Parameter name="host"><![CDATA[localhost]]></Parameter>
<Parameter name="key_field"><![CDATA[]]></Parameter>
<Parameter name="max_size"><![CDATA[512]]></Parameter>
<Parameter name="password"><![CDATA[postgres]]></Parameter>
<Parameter name="port"><![CDATA[5432]]></Parameter>
<Parameter name="table"><![CDATA[(
select geometry, osm_id, oneway, type, 'motorway' as class from
osm_roads where bridge = 0 and tunnel = 0 and type in ('motorway')
and z(!scale_denominator!) >= 5
union all
select geometry, osm_id, oneway, type, 'motorway_link' as class from
osm_roads where bridge = 0 and tunnel = 0 and type in ('motorway_link')
and z(!scale_denominator!) >= 13
union all
select geometry, osm_id, oneway, type, 'main' as class from
osm_roads where bridge = 0 and tunnel = 0 and type in ('primary',
'primary_link', 'trunk', 'trunk_link')
and z(!scale_denominator!) >= 5
union all
select geometry, osm_id, oneway, type, 'main' as class from
osm_roads where bridge = 0 and tunnel = 0 and type in ('secondary',
'secondary_link')
and z(!scale_denominator!) >= 9
union all
select geometry, osm_id, oneway, type, 'main' as class from
osm_roads where bridge = 0 and tunnel = 0 and type in ('tertiary',
'tertiary_link')
and z(!scale_denominator!) >= 12
union all
select geometry, osm_id, oneway, type, 'street' as class from
osm_roads where bridge = 0 and tunnel = 0 and type in ('residential',
'unclassified', 'living_street')
and z(!scale_denominator!) >= 12
union all
select geometry, osm_id, oneway, type, 'street_limited' as class from
osm_roads where bridge = 0 and tunnel = 0 and (type in ('pedestrian',
'construction') or access = 'private')
and z(!scale_denominator!) >= 12
union all
select geometry, osm_id, oneway, type, 'service' as class from
osm_roads where bridge = 0 and tunnel = 0 and type in ('service',
'track')
and z(!scale_denominator!) >= 15
union all
select geometry, osm_id, oneway, type, 'driveway' as class from
osm_roads where bridge = 0 and tunnel = 0 and type in ('driveway')
and z(!scale_denominator!) >= 15
union all
select geometry, osm_id, oneway, type, 'path' as class from
osm_roads where bridge = 0 and tunnel = 0 and type in ('path',
'cycleway', 'ski', 'steps', 'bridleway')
and z(!scale_denominator!) >= 15
union all
select geometry, osm_id, oneway, type, 'major_rail' as class from
osm_roads where bridge = 0 and tunnel = 0 and type in ('rail',
'monorail', 'narrow_gauge', 'subway', 'tram')
and z(!scale_denominator!) >= 12
union all
select geometry, osm_id, oneway, type, 'minor_rail' as class from
osm_roads where bridge = 0 and tunnel = 0 and type in ('funicular',
'light_rail', 'preserved')
and z(!scale_denominator!) >= 15
/* TODO aerialway, golf */
) AS data]]></Parameter>
<Parameter name="type"><![CDATA[postgis]]></Parameter>
<Parameter name="user"><![CDATA[postgres]]></Parameter>
</Datasource>
</Layer>
<Layer name="bridge"
buffer-size="8"
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<Datasource>
<Parameter name="dbname"><![CDATA[osm_tanzania]]></Parameter>
<Parameter name="extent"><![CDATA[-20037508.34,-20037508.34,20037508.34,20037508.34]]></Parameter>
<Parameter name="geometry_field"><![CDATA[]]></Parameter>
<Parameter name="geometry_table"><![CDATA[]]></Parameter>
<Parameter name="host"><![CDATA[localhost]]></Parameter>
<Parameter name="key_field"><![CDATA[]]></Parameter>
<Parameter name="max_size"><![CDATA[512]]></Parameter>
<Parameter name="password"><![CDATA[postgres]]></Parameter>
<Parameter name="port"><![CDATA[5432]]></Parameter>
<Parameter name="table"><![CDATA[(
select geometry, osm_id, oneway, layer, type, 'motorway' as class from
osm_roads where bridge = 1 and type in ('motorway')
and z(!scale_denominator!) >= 5
union all
select geometry, osm_id, oneway, layer, type, 'motorway_link' as class from
osm_roads where bridge = 1 and type in ('motorway_link')
and z(!scale_denominator!) >= 13
union all
select geometry, osm_id, oneway, layer, type, 'main' as class from
osm_roads where bridge = 1 and type in ('primary',
'primary_link', 'trunk', 'trunk_link')
and z(!scale_denominator!) >= 5
union all
select geometry, osm_id, oneway, layer, type, 'main' as class from
osm_roads where bridge = 1 and type in ('secondary',
'secondary_link')
and z(!scale_denominator!) >= 9
union all
select geometry, osm_id, oneway, layer, type, 'main' as class from
osm_roads where bridge = 1 and type in ('tertiary',
'tertiary_link')
and z(!scale_denominator!) >= 12
union all
select geometry, osm_id, oneway, layer, type, 'street' as class from
osm_roads where bridge = 1 and type in ('residential',
'unclassified', 'living_street')
and z(!scale_denominator!) >= 12
union all
select geometry, osm_id, oneway, layer, type, 'street_limited' as class from
osm_roads where bridge = 1 and (type in ('pedestrian',
'construction') or access = 'private')
and z(!scale_denominator!) >= 12
union all
select geometry, osm_id, oneway, layer, type, 'service' as class from
osm_roads where bridge = 1 and type in ('service',
'track')
and z(!scale_denominator!) >= 15
union all
select geometry, osm_id, oneway, layer, type, 'driveway' as class from
osm_roads where bridge = 1 and type in ('driveway')
and z(!scale_denominator!) >= 15
union all
select geometry, osm_id, oneway, layer, type, 'path' as class from
osm_roads where bridge = 1 and type in ('path',
'cycleway', 'ski', 'steps', 'bridleway')
and z(!scale_denominator!) >= 15
union all
select geometry, osm_id, oneway, layer, type, 'major_rail' as class from
osm_roads where bridge = 1 and type in ('rail',
'monorail', 'narrow_gauge', 'subway', 'tram')
and z(!scale_denominator!) >= 12
union all
select geometry, osm_id, oneway, layer, type, 'minor_rail' as class from
osm_roads where bridge = 1 and type in ('funicular',
'light_rail', 'preserved')
and z(!scale_denominator!) >= 15
/* TODO aerialway, golf */
) AS data]]></Parameter>
<Parameter name="type"><![CDATA[postgis]]></Parameter>
<Parameter name="user"><![CDATA[postgres]]></Parameter>
</Datasource>
</Layer>
<Layer name="tunnel"
buffer-size="8"
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<Datasource>
<Parameter name="dbname"><![CDATA[osm_tanzania]]></Parameter>
<Parameter name="extent"><![CDATA[-20037508.34,-20037508.34,20037508.34,20037508.34]]></Parameter>
<Parameter name="geometry_field"><![CDATA[]]></Parameter>
<Parameter name="geometry_table"><![CDATA[]]></Parameter>
<Parameter name="host"><![CDATA[localhost]]></Parameter>
<Parameter name="key_field"><![CDATA[]]></Parameter>
<Parameter name="max_size"><![CDATA[512]]></Parameter>
<Parameter name="password"><![CDATA[postgres]]></Parameter>
<Parameter name="port"><![CDATA[5432]]></Parameter>
<Parameter name="table"><![CDATA[(
select geometry, osm_id, oneway, layer, type, 'motorway' as class from
osm_roads where tunnel = 1 and type in ('motorway')
and z(!scale_denominator!) >= 5
union all
select geometry, osm_id, oneway, layer, type, 'motorway_link' as class from
osm_roads where tunnel = 1 and type in ('motorway_link')
and z(!scale_denominator!) >= 13
union all
select geometry, osm_id, oneway, layer, type, 'main' as class from
osm_roads where tunnel = 1 and type in ('primary',
'primary_link', 'trunk', 'trunk_link')
and z(!scale_denominator!) >= 5
union all
select geometry, osm_id, oneway, layer, type, 'main' as class from
osm_roads where tunnel = 1 and type in ('secondary',
'secondary_link')
and z(!scale_denominator!) >= 9
union all
select geometry, osm_id, oneway, layer, type, 'main' as class from
osm_roads where tunnel = 1 and type in ('tertiary',
'tertiary_link')
and z(!scale_denominator!) >= 12
union all
select geometry, osm_id, oneway, layer, type, 'street' as class from
osm_roads where tunnel = 1 and type in ('residential',
'unclassified', 'living_street')
and z(!scale_denominator!) >= 12
union all
select geometry, osm_id, oneway, layer, type, 'street_limited' as class from
osm_roads where tunnel = 1 and (type in ('pedestrian',
'construction') or access = 'private')
and z(!scale_denominator!) >= 12
union all
select geometry, osm_id, oneway, layer, type, 'service' as class from
osm_roads where tunnel = 1 and type in ('service',
'track')
and z(!scale_denominator!) >= 15
union all
select geometry, osm_id, oneway, layer, type, 'driveway' as class from
osm_roads where tunnel = 1 and type in ('driveway')
and z(!scale_denominator!) >= 15
union all
select geometry, osm_id, oneway, layer, type, 'path' as class from
osm_roads where tunnel = 1 and type in ('path',
'cycleway', 'ski', 'steps', 'bridleway')
and z(!scale_denominator!) >= 15
union all
select geometry, osm_id, oneway, layer, type, 'major_rail' as class from
osm_roads where tunnel = 1 and type in ('rail',
'monorail', 'narrow_gauge', 'subway', 'tram')
and z(!scale_denominator!) >= 12
union all
select geometry, osm_id, oneway, layer, type, 'minor_rail' as class from
osm_roads where tunnel = 1 and type in ('funicular',
'light_rail', 'preserved')
and z(!scale_denominator!) >= 15
) AS data]]></Parameter>
<Parameter name="type"><![CDATA[postgis]]></Parameter>
<Parameter name="user"><![CDATA[postgres]]></Parameter>
</Datasource>
</Layer>
<Layer name="admin"
buffer-size="8"
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<Datasource>
<Parameter name="dbname"><![CDATA[osm_tanzania]]></Parameter>
<Parameter name="extent"><![CDATA[-20037508.34,-20037508.34,20037508.34,20037508.34]]></Parameter>
<Parameter name="geometry_field"><![CDATA[]]></Parameter>
<Parameter name="geometry_table"><![CDATA[]]></Parameter>
<Parameter name="host"><![CDATA[localhost]]></Parameter>
<Parameter name="key_field"><![CDATA[]]></Parameter>
<Parameter name="max_size"><![CDATA[512]]></Parameter>
<Parameter name="password"><![CDATA[postgres]]></Parameter>
<Parameter name="port"><![CDATA[5432]]></Parameter>
<Parameter name="table"><![CDATA[(
/* TODO calculate maritime */
select geometry, osm_id, admin_level, 0 as disputed, 0 as maritime
from osm_admin
where admin_level = 2
union all
select geometry, osm_id, admin_level, 0 as disputed, 0 as maritime
from osm_admin
where admin_level = 4
and z(!scale_denominator!) >= 5
) AS data]]></Parameter>
<Parameter name="type"><![CDATA[postgis]]></Parameter>
<Parameter name="user"><![CDATA[postgres]]></Parameter>
</Datasource>
</Layer>
<Layer name="country_label"
buffer-size="128"
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<Datasource>
<Parameter name="dbname"><![CDATA[osm_tanzania]]></Parameter>
<Parameter name="extent"><![CDATA[-20037508.34,-20037508.34,20037508.34,20037508.34]]></Parameter>
<Parameter name="geometry_field"><![CDATA[]]></Parameter>
<Parameter name="geometry_table"><![CDATA[]]></Parameter>
<Parameter name="host"><![CDATA[localhost]]></Parameter>
<Parameter name="key_field"><![CDATA[]]></Parameter>
<Parameter name="max_size"><![CDATA[512]]></Parameter>
<Parameter name="password"><![CDATA[postgres]]></Parameter>
<Parameter name="port"><![CDATA[5432]]></Parameter>
<Parameter name="table"><![CDATA[(
/* TODO get real name_en/name_de/name_es */
/* TODO improve ranking */
select geometry, osm_id, name, name as name_en, 1 as rank from osm_places
where type = 'country' and
population >= 250000000
union all
select geometry, osm_id, name, name as name_en, 2 as rank from osm_places
where type = 'country' and
population >= 100000000 and population < 250000000
union all
select geometry, osm_id, name, name as name_en, 3 as rank from osm_places
where type = 'country' and
population >= 50000000 and population < 100000000
union all
select geometry, osm_id, name, name as name_en, 4 as rank from osm_places
where type = 'country' and
population >= 25000000 and population < 50000000
union all
select geometry, osm_id, name, name as name_en, 5 as rank from osm_places
where type = 'country' and
population >= 10000000 and population < 25000000
union all
select geometry, osm_id, name, name as name_en, 6 as rank from osm_places
where type = 'country' and
population < 10000000
) AS data]]></Parameter>
<Parameter name="type"><![CDATA[postgis]]></Parameter>
<Parameter name="user"><![CDATA[postgres]]></Parameter>
</Datasource>
</Layer>
<Layer name="state_label"
buffer-size="128"
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<Datasource>
<Parameter name="dbname"><![CDATA[osm_tanzania]]></Parameter>
<Parameter name="extent"><![CDATA[-20037508.34,-20037508.34,20037508.34,20037508.34]]></Parameter>
<Parameter name="geometry_field"><![CDATA[]]></Parameter>
<Parameter name="geometry_table"><![CDATA[]]></Parameter>
<Parameter name="host"><![CDATA[localhost]]></Parameter>
<Parameter name="key_field"><![CDATA[]]></Parameter>
<Parameter name="max_size"><![CDATA[512]]></Parameter>
<Parameter name="password"><![CDATA[postgres]]></Parameter>
<Parameter name="port"><![CDATA[5432]]></Parameter>
<Parameter name="table"><![CDATA[(
/* TODO get real name_en/name_de/name_es */
/* TODO get real area */
select geometry, osm_id, name, name as name_en, 0 as area from osm_places
where type = 'state'
) AS data]]></Parameter>
<Parameter name="type"><![CDATA[postgis]]></Parameter>
<Parameter name="user"><![CDATA[postgres]]></Parameter>
</Datasource>
</Layer>
<Layer name="place_label"
buffer-size="256"
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<Datasource>
<Parameter name="dbname"><![CDATA[osm_tanzania]]></Parameter>
<Parameter name="extent"><![CDATA[-20037508.34,-20037508.34,20037508.34,20037508.34]]></Parameter>
<Parameter name="geometry_field"><![CDATA[]]></Parameter>
<Parameter name="geometry_table"><![CDATA[]]></Parameter>
<Parameter name="host"><![CDATA[localhost]]></Parameter>
<Parameter name="key_field"><![CDATA[]]></Parameter>
<Parameter name="max_size"><![CDATA[512]]></Parameter>
<Parameter name="password"><![CDATA[postgres]]></Parameter>
<Parameter name="port"><![CDATA[5432]]></Parameter>
<Parameter name="table"><![CDATA[(
/* TODO get real name_en/name_de/name_es */
/* TODO calculate real ranks and ldir */
select geometry, osm_id, name, name as name_en, type,
null as capital, 'SE' as ldir, 1 as localrank, null as scalerank
from osm_places
where type = 'city'
union all
select geometry, osm_id, name, name as name_en, type,
null as capital, 'SE' as ldir, 1 as localrank, null as scalerank
from osm_places
where type = 'town' and z(!scale_denominator!) >= 7
union all
select geometry, osm_id, name, name as name_en, type,
null as capital, 'SE' as ldir, 1 as localrank, null as scalerank
from osm_places
where type = 'village' and z(!scale_denominator!) >= 10
union all
select geometry, osm_id, name, name as name_en, type,
null as capital, 'SE' as ldir, 1 as localrank, null as scalerank
from osm_places
where type in ('hamlet', 'suburb','neighbourhood') and
z(!scale_denominator!) >= 12
) AS data]]></Parameter>
<Parameter name="type"><![CDATA[postgis]]></Parameter>
<Parameter name="user"><![CDATA[postgres]]></Parameter>
</Datasource>
</Layer>
<Layer name="road_label"
buffer-size="128"
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<Datasource>
<Parameter name="dbname"><![CDATA[osm_tanzania]]></Parameter>
<Parameter name="extent"><![CDATA[-20037508.34,-20037508.34,20037508.34,20037508.34]]></Parameter>
<Parameter name="geometry_field"><![CDATA[]]></Parameter>
<Parameter name="geometry_table"><![CDATA[]]></Parameter>
<Parameter name="host"><![CDATA[localhost]]></Parameter>
<Parameter name="key_field"><![CDATA[]]></Parameter>
<Parameter name="max_size"><![CDATA[512]]></Parameter>
<Parameter name="password"><![CDATA[postgres]]></Parameter>
<Parameter name="port"><![CDATA[5432]]></Parameter>
<Parameter name="table"><![CDATA[(
select geometry, osm_id,
name, name as name_en, ref, char_length(ref) as reflen,
round(st_length(geometry)) as len, 'motorway' as class
from osm_roads
where bridge = 0 and tunnel = 0 and type in ('motorway')
and z(!scale_denominator!) >= 5
union all
select geometry, osm_id,
name, name as name_en, ref, char_length(ref) as reflen,
round(st_length(geometry)) as len, 'motorway_link' as class
from osm_roads
where bridge = 0 and tunnel = 0 and type in ('motorway_link')
and z(!scale_denominator!) >= 13
union all
select geometry, osm_id,
name, name as name_en, ref, char_length(ref) as reflen,
round(st_length(geometry)) as len, 'main' as class
from osm_roads
where bridge = 0 and tunnel = 0 and type in ('primary',
'primary_link', 'trunk', 'trunk_link')
and z(!scale_denominator!) >= 5
union all
select geometry, osm_id,
name, name as name_en, ref, char_length(ref) as reflen,
round(st_length(geometry)) as len, 'main' as class
from osm_roads
where bridge = 0 and tunnel = 0 and type in ('secondary',
'secondary_link')
and z(!scale_denominator!) >= 9
union all
select geometry, osm_id,
name, name as name_en, ref, char_length(ref) as reflen,
round(st_length(geometry)) as len, 'main' as class
from osm_roads
where bridge = 0 and tunnel = 0 and type in ('tertiary',
'tertiary_link')
and z(!scale_denominator!) >= 12
union all
select geometry, osm_id,
name, name as name_en, ref, char_length(ref) as reflen,
round(st_length(geometry)) as len, 'street' as class
from osm_roads
where bridge = 0 and tunnel = 0 and type in ('residential',
'unclassified', 'living_street')
and z(!scale_denominator!) >= 12
union all
select geometry, osm_id,
name, name as name_en, ref, char_length(ref) as reflen,
round(st_length(geometry)) as len, 'street_limited' as class
from osm_roads
where bridge = 0 and tunnel = 0 and (type in ('pedestrian',
'construction') or access = 'private')
and z(!scale_denominator!) >= 12
union all
select geometry, osm_id,
name, name as name_en, ref, char_length(ref) as reflen,
round(st_length(geometry)) as len, 'service' as class
from osm_roads
where bridge = 0 and tunnel = 0 and type in ('service',
'track')
and z(!scale_denominator!) >= 15
union all
select geometry, osm_id,
name, name as name_en, ref, char_length(ref) as reflen,
round(st_length(geometry)) as len, 'driveway' as class
from osm_roads
where bridge = 0 and tunnel = 0 and type in ('driveway')
and z(!scale_denominator!) >= 15
union all
select geometry, osm_id,
name, name as name_en, ref, char_length(ref) as reflen,
round(st_length(geometry)) as len, 'path' as class
from osm_roads
where bridge = 0 and tunnel = 0 and type in ('path',
'cycleway', 'ski', 'steps', 'bridleway')
and z(!scale_denominator!) >= 15
) AS data]]></Parameter>
<Parameter name="type"><![CDATA[postgis]]></Parameter>
<Parameter name="user"><![CDATA[postgres]]></Parameter>
</Datasource>
</Layer>
<Layer name="waterway_label"
buffer-size="128"
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<Datasource>
<Parameter name="dbname"><![CDATA[osm_tanzania]]></Parameter>
<Parameter name="extent"><![CDATA[-20037508.34,-20037508.34,20037508.34,20037508.34]]></Parameter>
<Parameter name="geometry_field"><![CDATA[]]></Parameter>
<Parameter name="geometry_table"><![CDATA[]]></Parameter>
<Parameter name="host"><![CDATA[localhost]]></Parameter>
<Parameter name="key_field"><![CDATA[]]></Parameter>
<Parameter name="max_size"><![CDATA[512]]></Parameter>
<Parameter name="password"><![CDATA[postgres]]></Parameter>
<Parameter name="port"><![CDATA[5432]]></Parameter>
<Parameter name="table"><![CDATA[(
select geometry, osm_id,
name, name as name_en, type, type as class from osm_waterareas
where type in ('river', 'canal')
and z(!scale_denominator!) >= 8
union all
select geometry, osm_id,
name, name as name_en, type, type as class from osm_waterareas
where type in ('stream', 'stream_intermittent')
and z(!scale_denominator!) >= 13
union all
select geometry, osm_id,
name, name as name_en, type, type as class from osm_waterareas
where type in ('drain', 'ditch')
and z(!scale_denominator!) >= 15
) AS data]]></Parameter>
<Parameter name="type"><![CDATA[postgis]]></Parameter>
<Parameter name="user"><![CDATA[postgres]]></Parameter>
</Datasource>
</Layer>
<Layer name="water_label"
buffer-size="128"
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<Datasource>
<Parameter name="dbname"><![CDATA[osm_tanzania]]></Parameter>
<Parameter name="extent"><![CDATA[-20037508.34,-20037508.34,20037508.34,20037508.34]]></Parameter>
<Parameter name="geometry_field"><![CDATA[]]></Parameter>
<Parameter name="geometry_table"><![CDATA[]]></Parameter>
<Parameter name="host"><![CDATA[localhost]]></Parameter>
<Parameter name="key_field"><![CDATA[]]></Parameter>
<Parameter name="max_size"><![CDATA[512]]></Parameter>
<Parameter name="password"><![CDATA[postgres]]></Parameter>
<Parameter name="port"><![CDATA[5432]]></Parameter>
<Parameter name="table"><![CDATA[(
select ST_PointOnSurface(geometry) as geometry, osm_id,
name, name as name_en, ST_Area(geometry) as area from osm_waterareas
where st_area(geometry) >= 5000000000
and z(!scale_denominator!) >= 5
union all
select ST_PointOnSurface(geometry) as geometry, osm_id,
name, name as name_en, ST_Area(geometry) as area from osm_waterareas
where st_area(geometry) < 5000000000 and st_area(geometry) >= 1500000000
and z(!scale_denominator!) >= 5
union all
select ST_PointOnSurface(geometry) as geometry, osm_id,
name, name as name_en, ST_Area(geometry) as area from osm_waterareas
where st_area(geometry) < 1500000000 and st_area(geometry) >= 500000000
and z(!scale_denominator!) >= 8
union all
select ST_PointOnSurface(geometry) as geometry, osm_id,
name, name as name_en, ST_Area(geometry) as area from osm_waterareas
where st_area(geometry) < 500000000 and st_area(geometry) >= 100000000
and z(!scale_denominator!) >= 9
union all
select ST_PointOnSurface(geometry) as geometry, osm_id,
name, name as name_en, ST_Area(geometry) as area from osm_waterareas
where st_area(geometry) < 100000000 and st_area(geometry) >= 40000000
and z(!scale_denominator!) >= 10
union all
select ST_PointOnSurface(geometry) as geometry, osm_id,
name, name as name_en, ST_Area(geometry) as area from osm_waterareas
where st_area(geometry) < 40000000 and st_area(geometry) >= 20000000
and z(!scale_denominator!) >= 11
union all
select ST_PointOnSurface(geometry) as geometry, osm_id,
name, name as name_en, ST_Area(geometry) as area from osm_waterareas
where st_area(geometry) < 20000000 and st_area(geometry) >= 10000000
and z(!scale_denominator!) >= 12
union all
select ST_PointOnSurface(geometry) as geometry, osm_id,
name, name as name_en, ST_Area(geometry) as area from osm_waterareas
where st_area(geometry) < 10000000
and z(!scale_denominator!) >= 13
) AS data]]></Parameter>
<Parameter name="type"><![CDATA[postgis]]></Parameter>
<Parameter name="user"><![CDATA[postgres]]></Parameter>
</Datasource>
</Layer>
<Layer name="poi_label"
buffer-size="128"
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<Datasource>
<Parameter name="dbname"><![CDATA[osm_tanzania]]></Parameter>
<Parameter name="extent"><![CDATA[-20037508.34,-20037508.34,20037508.34,20037508.34]]></Parameter>
<Parameter name="geometry_field"><![CDATA[]]></Parameter>
<Parameter name="geometry_table"><![CDATA[]]></Parameter>
<Parameter name="host"><![CDATA[localhost]]></Parameter>
<Parameter name="key_field"><![CDATA[]]></Parameter>
<Parameter name="max_size"><![CDATA[512]]></Parameter>
<Parameter name="password"><![CDATA[postgres]]></Parameter>
<Parameter name="port"><![CDATA[5432]]></Parameter>
<Parameter name="table"><![CDATA[(
/* TODO calculate real ranks */
/* TODO improve assigning maki icon */
select geometry, osm_id,
name, name as name_en, type, 3 as scalerank, 1 as localrank,
(CASE WHEN replace(type, '_', '-') in ('airfield','london-underground','airport','marker','alcohol-shop','marker-stroked','america-football','minefield','art-gallery','mobilephone','bakery','monument','bank','museum','bar','music','baseball','oil-well','basketball','park2','beer','park','bicycle','parking','building','parking-garage','bus','pharmacy','cafe','pitch','camera','place-of-worship','campsite','playground','car','police','cemetery','polling-place','chemist','post','cinema','prison','circle','rail','circle-stroked','rail-above','city','rail-light','clothing-store','rail-metro','college','rail-underground','commercial','religious-christian','cricket','religious-jewish','cross','religious-muslim','dam','restaurant','danger','roadblock','disability','rocket','dog-park','school','embassy','scooter','emergency-telephone','shop','entrance','skiing','farm','slaughterhouse','fast-food','soccer','ferry','square','fire-station','square-stroked','fuel','star','garden','star-stroked','gift','suitcase','golf','swimming','grocery','telephone','hairdresser','tennis','harbor','theatre','heart','toilets','heliport','town','hospital','town-hall','ice-cream','triangle','industrial','triangle-stroked','land-use','village','laundry','warehouse','library','waste-basket','lighthouse','water','lodging','wetland','logging','zoo')
THEN replace(type, '_', '-')
ELSE null
END) as maki
from osm_amenities
where z(!scale_denominator!) >= 16
) AS data]]></Parameter>
<Parameter name="type"><![CDATA[postgis]]></Parameter>
<Parameter name="user"><![CDATA[postgres]]></Parameter>
</Datasource>
</Layer>
</Map>