forked from Ahlzen/TopOSM
-
Notifications
You must be signed in to change notification settings - Fork 1
/
features_labels.mml
110 lines (107 loc) · 5.71 KB
/
features_labels.mml
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
# -*- yaml -*-
name: TopOSM Feature Labels
description: Feature label layer for TopOSM.
scale: 1
metatile: 2
bounds:
- -180
- -85.05112877980659
- 180
- 85.05112877980659
center:
- 0
- 0
- 4
format: png
interactivity: false
minzoom: 0
maxzoom: 22
srs: &srs +proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs +type=crs
Stylesheet:
- colors.mss
- fonts.mss
- features_labels.mss
_parts:
osm2pgsql: &osm2pgsql
type: postgis
dbname: osm
port: 5433
extent: -20037508,-19929239,20037508,19929239
Layer:
- id: statenames
name: statenames
srs: *srs
Datasource:
<<: *osm2pgsql
table: (SELECT way, place, name, ref FROM planet_osm_point WHERE place = 'state') AS statenames
- id: placenames
name: placenames
srs: *srs
Datasource:
<<: *osm2pgsql
table: (SELECT way, name, place, CASE WHEN place = 'city' THEN 2 WHEN place = 'town' THEN 4 WHEN place = 'suburb' THEN 5 WHEN place = 'village' THEN 6 WHEN place = 'hamlet' THEN 7 WHEN place = 'island' THEN 8 WHEN place = 'locality' THEN 9 ELSE 10 END AS place_order FROM planet_osm_point WHERE place IS NOT NULL AND name IS NOT NULL ORDER BY place_order) AS placenames
- id: feature-area-names
name: feature-area-names
class: featurenames
srs: *srs
Datasource:
<<: *osm2pgsql
table: (SELECT way, name, coalesce('natural_' || "natural", 'aeroway_' || aeroway, 'railway_' || railway, 'landuse_' || landuse, 'leisure_' || leisure, 'amenity_' || amenity, 'boundary_' || boundary) AS feature, way_area, way_area / (!pixel_width!*!pixel_height!) AS way_area_pixels, 0 AS ele_w_unit FROM planet_osm_polygon WHERE name IS NOT NULL ORDER BY z_order, way_area DESC) AS featurenames
- id: feature-point-names
name: feature-point-names
class: featurenames
srs: *srs
Datasource:
<<: *osm2pgsql
table: (SELECT way, name, coalesce('natural_' || "natural", 'aeroway_' || aeroway, 'railway_' || railway, 'landuse_' || landuse, 'leisure_' || leisure, 'amenity_' || amenity, 'boundary_' || boundary) AS feature, 0 AS way_area, 0 AS way_area_pixels, round(CAST(NULLIF(regexp_replace(ele, '^([0-9]*).*$', '\1'), '') AS NUMERIC) / 0.3048) || ' ft' as ele_w_unit FROM planet_osm_point WHERE name IS NOT NULL OR ele IS NOT NULL ORDER BY z_order, way_area DESC) AS featurenames
- id: shields-very-low-zoom
name: shields-very-low-zoom
srs: *srs
Datasource:
<<: *osm2pgsql
table: (SELECT way, shields_get_single_filename(network, NULL, ref) AS route_shield FROM planet_osm_line WHERE osm_id < 0 AND route = 'road' AND (network = 'US:I' AND char_length(ref) BETWEEN 1 AND 2) ORDER BY ST_Length(way) DESC) AS shields
- id: shields-low-zoom
name: shields-low-zoom
srs: *srs
Datasource:
<<: *osm2pgsql
table: (SELECT way, highway, ref, char_length(ref) AS length, shields_get_filename(osm_id, way) AS route_shield FROM planet_osm_roads WHERE highway IN ('motorway', 'trunk', 'primary', 'secondary') AND ((ref IS NOT NULL AND char_length(ref) BETWEEN 1 AND 8) OR shields_get_route_memberships(osm_id) IS NOT NULL)) AS shields
- id: shields
name: shields
srs: *srs
Datasource:
<<: *osm2pgsql
table: (SELECT way, highway, ref, char_length(ref) as length, shields_get_filename(osm_id, way) route_shield FROM planet_osm_line WHERE highway IS NOT NULL AND ((ref IS NOT NULL AND char_length(ref) BETWEEN 1 AND 16) OR shields_get_route_memberships(osm_id) IS NOT NULL)) AS shields
- id: streetnames
name: streetnames
class: streetnames trailnames
srs: *srs
Datasource:
<<: *osm2pgsql
table: (SELECT way, highway, name, tunnel FROM planet_osm_line WHERE name IS NOT NULL ORDER BY z_order) AS streetnames
- id: water-area-names
name: water-area-names
srs: *srs
Datasource:
<<: *osm2pgsql
table: (SELECT way, waterway, landuse, "natural", name, way_area, way_area / (!pixel_width!*!pixel_height!) AS way_area_pixels FROM planet_osm_polygon WHERE (landuse IN ('reservoir', 'basin') OR "natural" IN ('water', 'wetland', 'glacier')) AND name IS NOT NULL ORDER BY way_area DESC) AS water_areas
- id: water-line-names
name: water-line-names
srs: *srs
Datasource:
<<: *osm2pgsql
table: (SELECT way, waterway, disused, name, ST_Length(way) length FROM planet_osm_line WHERE waterway IS NOT NULL AND name IS NOT NULL ORDER BY z_order, length DESC) AS water_lines
- id: area-icons
name: area-icons
class: icons
srs: *srs
Datasource:
<<: *osm2pgsql
table: (SELECT way, coalesce('natural_' || "natural", 'power_' || power, 'aeroway_' || aeroway, 'railway_' || railway, 'aerialway_' || aerialway, 'tourism_' || tourism, 'amenity_' || amenity, 'landuse_' || landuse, 'man_made_' || man_made) AS feature, access, "tower:type" AS tower_type FROM planet_osm_polygon WHERE "natural" IS NOT NULL OR power IS NOT NULL OR aeroway IS NOT NULL OR railway IS NOT NULL OR aerialway IS NOT NULL OR tourism IS NOT NULL OR amenity IS NOT NULL OR landuse IS NOT NULL OR man_made IS NOT NULL ORDER BY way_area DESC) as icons
- id: point-icons
name: point-icons
class: icons
srs: *srs
Datasource:
<<: *osm2pgsql
table: (SELECT way, coalesce('natural_' || "natural", 'power_' || power, 'aeroway_' || aeroway, 'railway_' || railway, 'aerialway_' || aerialway, 'tourism_' || tourism, 'amenity_' || amenity, 'landuse_' || landuse, 'man_made_' || man_made) AS feature, access, "tower:type" AS tower_type FROM planet_osm_point WHERE "natural" IS NOT NULL OR power IS NOT NULL OR aeroway IS NOT NULL OR railway IS NOT NULL OR aerialway IS NOT NULL OR tourism IS NOT NULL OR amenity IS NOT NULL OR landuse IS NOT NULL OR man_made IS NOT NULL) as icons