source: subversion/sites/www.openstreetbrowser.org/render/template_layer1.mml @ 17961

Last change on this file since 17961 was 16408, checked in by skunk, 11 years ago

Files missing (please don't ask me why)

File size: 7.3 KB
Line 
1<!-- Layer %LAYER_NUM% -->
2  <Layer class="roads_casing" status="on" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over">
3    <Datasource>
4      <Parameter name="type">postgis</Parameter>
5      <Parameter name="dbname">__DBNAME__</Parameter>
6      <Parameter name="table">
7        (select way,
8          %SQL_bridge_tunnel%,
9          highway,
10          %SQL_HIGHWAY_TYPE%
11          from planet_osm_line
12          where %LAYER_WHERE%
13          order by %SQL_highway_level% asc
14        ) as t1
15      </Parameter>
16      <Parameter name="estimate_extent">false</Parameter>
17      <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
18    </Datasource>
19  </Layer>
20  <Layer class="square_casing" status="on" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over">
21    <Datasource>
22      <Parameter name="type">postgis</Parameter>
23      <Parameter name="dbname">__DBNAME__</Parameter>
24      <Parameter name="table">
25        (select way,
26            %SQL_bridge_tunnel%,
27            (CASE
28              WHEN "highway"='pedestrian' THEN 'pedestrian'
29              WHEN "amenity"='parking' THEN 'parking'
30              END) as type
31          from planet_osm_polygon
32          where %LAYER_WHERE%
33          and ("highway"='pedestrian' or "amenity"='parking')
34        ) as t2
35      </Parameter>
36      <Parameter name="estimate_extent">false</Parameter>
37      <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
38    </Datasource>
39  </Layer>
40  <Layer class="square_fill" status="on" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over">
41    <Datasource>
42      <Parameter name="type">postgis</Parameter>
43      <Parameter name="dbname">__DBNAME__</Parameter>
44      <Parameter name="table">
45        (select way,
46            %SQL_bridge_tunnel%,
47            (CASE
48              WHEN "highway"='pedestrian' THEN 'pedestrian'
49              WHEN "amenity"='parking' THEN 'parking'
50              END) as type
51          from planet_osm_polygon
52          where %LAYER_WHERE%
53          and ("highway"='pedestrian' or "amenity"='parking')
54        ) as t3
55      </Parameter>
56      <Parameter name="estimate_extent">false</Parameter>
57      <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
58    </Datasource>
59  </Layer>
60  <Layer class="roads_fill" status="on" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over">
61    <Datasource>
62      <Parameter name="type">postgis</Parameter>
63      <Parameter name="dbname">__DBNAME__</Parameter>
64      <Parameter name="table">
65        (select way,
66          %SQL_bridge_tunnel%,
67          highway, railway,
68          %SQL_HIGHWAY_TYPE%
69          from planet_osm_line
70          where %LAYER_WHERE%
71          order by %SQL_highway_level% asc
72        ) as t4
73      </Parameter>
74      <Parameter name="estimate_extent">false</Parameter>
75      <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
76    </Datasource>
77  </Layer>
78  <Layer class="roads_rail" status="on" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over">
79    <Datasource>
80      <Parameter name="type">postgis</Parameter>
81      <Parameter name="dbname">__DBNAME__</Parameter>
82      <Parameter name="table">
83        (select way,
84          %SQL_bridge_tunnel%,
85          highway,
86          (CASE
87            WHEN "railway" in ('tram', 'light_rail') THEN 'tram'
88            WHEN "railway" in ('rail', 'narrow_gauge', 'monorail', 'subway') THEN 'rail'
89            END) as railway,
90          (CASE WHEN "railway" in ('subway', 'tram', 'light_rail') THEN
91            (CASE
92              WHEN "tracks" in ('left', 'right') THEN "tracks"
93              WHEN "tracks" in ('1', 'single') THEN 'single'
94              WHEN "tracks" in ('3', '4', '5', '6') THEN  'multiple'
95              ELSE 'double' END)
96          ELSE
97            (CASE
98              WHEN "tracks" in ('2', 'double') THEN 'double'
99              WHEN "tracks" in ('3', '4', '5', '6') THEN  'multiple'
100              ELSE 'single' END) END) as tracks
101          from planet_osm_line
102          where %LAYER_WHERE%
103          order by %SQL_highway_level% asc
104        ) as t5
105      </Parameter>
106      <Parameter name="estimate_extent">false</Parameter>
107      <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
108    </Datasource>
109  </Layer>
110  <Layer class="roads_features" status="on" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over">
111    <Datasource>
112      <Parameter name="type">postgis</Parameter>
113      <Parameter name="dbname">__DBNAME__</Parameter>
114      <Parameter name="table">
115        (select way,
116          %SQL_bridge_tunnel%,
117          highway,
118          %SQL_HIGHWAY_TYPE%
119          from planet_osm_line
120          where %LAYER_WHERE%
121          order by %SQL_highway_level% desc
122        ) as t6
123      </Parameter>
124      <Parameter name="estimate_extent">false</Parameter>
125      <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
126    </Datasource>
127  </Layer>
128  <Layer class="buildings" status="on" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over">
129    <Datasource>
130      <Parameter name="type">postgis</Parameter>
131      <Parameter name="dbname">__DBNAME__</Parameter>
132      <Parameter name="table">(select name, way,
133       (CASE
134          WHEN "amenity" in ('place_of_worship')
135            THEN 'worship'
136          WHEN "highway" in ('toll_booth')
137            OR "railway" in ('station', 'platform')
138            OR "aeroway" in ('terminal', 'helipad')
139            OR "aerialway" in ('station')
140            OR "amenity" in ('ferry_terminal')
141            THEN 'road_amenities'
142          WHEN "barrier" in ('hedge', 'fence')
143            THEN 'nature_building'
144          WHEN "power" in ('generator')
145            OR "man_made" in ('gasometer', 'wasterwater_plant', 'watermill', 'water_tower', 'water_works', 'windmill', 'works', 'reservoir_covered')
146            THEN 'industrial'
147          WHEN "amenity" in ('college', 'cinema', 'kindergarten', 'library', 'school', 'university')
148            THEN 'education'
149          WHEN "amenity" in ('theatre', 'arts_centre', 'cinema', 'fountain', 'studio')
150            THEN 'culture'
151          WHEN "shop" is not null
152            THEN 'shop'
153          WHEN "amenity" in ('hospital', 'emergency_phone', 'fire_station', 'police')
154            THEN 'emergency'
155          WHEN "amenity" in ('pharmacy', 'baby_hatch', 'dentist', 'doctors', 'veterinary')
156            THEN 'health'
157          WHEN "amenity" in ('government', 'gouvernment', 'public_building', 'court_house', 'embassy', 'prison', 'townhall')
158            THEN 'public'
159          WHEN "amenity" in ('post_office')
160            THEN 'communication'
161          WHEN "amenity" in ('hospital', 'baby_hatch', 'dentist', 'doctors', 'pharmacy', 'veterinary')
162            THEN 'public'
163          WHEN "tourism" in ('museum', 'artwork', 'attraction', 'viewpoint', 'theme_park', 'zoo')
164            THEN 'culture'
165          WHEN "military" is not null
166            THEN 'military'
167          WHEN "historic" is not null
168            THEN 'historic'
169          WHEN "building" in ('residental', 'residential', 'apartments', 'block', 'flats', 'appartments')
170             THEN 'residential'
171          WHEN "amenity" in ('bicycle_parking', 'bicycle_rental', 'shelter')
172            OR "leisure" in ('sports_centre', 'stadium', 'track', 'pitch', 'ice_rink')
173            OR "sport" is not null
174            THEN 'sport'
175          ELSE
176            'default'
177        END) as building
178         from planet_osm_polygon
179         where ("building" is not null or not "building" in ('no'))
180         and %LAYER_WHERE%
181         order by z_order,way_area desc) as buildings</Parameter>
182      <Parameter name="estimate_extent">false</Parameter>
183      <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
184    </Datasource>
185  </Layer>
186
Note: See TracBrowser for help on using the repository browser.