source: subversion/sites/www.openstreetbrowser.org/render/overlay_pt.mml @ 17240

Revision 17240, 20.0 KB checked in by skunk, 5 years ago (diff)

Merge branch 'pt_improv'

Line 
1<?xml version="1.0" encoding="utf-8"?>
2<!DOCTYPE Map>
3
4<Map 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">
5   <Stylesheet src="overlay_pt.mss" />
6
7   <Layer class="routes" name="routes" 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">
8    <Datasource>
9      <Parameter name="type">postgis</Parameter>
10      <Parameter name="dbname">__DBNAME__</Parameter>
11      <Parameter name="table">
12      (select way,
13         (array['local', 'suburban', 'urban', 'regional', 'national', 'international'])[max(CASE
14           WHEN importance='local' THEN 1
15           WHEN importance='suburban' THEN 2
16           WHEN importance='urban' THEN 3
17           WHEN importance='regional' THEN 4
18           WHEN importance='national' THEN 5
19           WHEN importance='international' THEN 6 END)] as importance,
20         (array['tram', 'bus', 'tram_bus'])[bit_or(CASE
21           WHEN route in ('tram', 'light_rail') THEN 1
22           WHEN route in ('trolley', 'bus', 'minibus') THEN 2
23           END)] as route,
24         (array['forward', 'backward', 'both'])[bit_or(CASE
25           WHEN role[1]='forward' THEN 1
26           WHEN role[1]='backward' THEN 2
27           ELSE 3
28         END)] as dir,
29          (array['single', 'double'])[bit_or(CASE
30            WHEN "route" in ('trolley', 'bus', 'minibus') THEN
31              (CASE
32                WHEN "oneway" in ('yes', 'true', '1') THEN 1
33                ELSE 2 END)
34            WHEN "route" in ('tram', 'light_rail') THEN
35              (CASE
36                WHEN "tracks" in ('1', 'single') THEN 1
37                ELSE 2 END)
38            ELSE
39              (CASE
40                WHEN "tracks" in ('2', 'double') THEN 2
41                ELSE 1 END) END)] as tracks,
42          (CASE WHEN "tunnel" in ('yes', 'true', '1') THEN 'yes' ELSE 'no' END) as tunnel,
43          (CASE
44            WHEN "highway" in ('unclassified', 'road', 'residential') THEN 'minor'
45            WHEN "highway" in ('living_street', 'pedestrian', 'byway') THEN 'pedestrian'
46            WHEN "highway" in ('service', 'bus_guideway') THEN 'service'
47            WHEN "highway" in ('primary', 'secondary', 'tertiary') THEN "highway"
48            WHEN "highway" in ('path', 'cycleway', 'footway', 'bridleway', 'steps') THEN 'path'
49            WHEN "railway" in ('tram', 'light_rail', 'narrow_gauge') THEN 'tram'
50            WHEN "railway" in ('rail', 'subway', 'preserved', 'monorail') THEN 'rail'
51            ELSE "highway" END) as highway_type
52       from planet_osm_line_route
53       where route in ('trolley', 'bus', 'minibus', 'tram', 'light_rail')
54       group by way, tunnel, highway_type) as routes
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="routes" name="routes" 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         (array['local', 'suburban', 'urban', 'regional', 'national', 'international'])[max(CASE
67           WHEN importance='local' THEN 1
68           WHEN importance='suburban' THEN 2
69           WHEN importance='urban' THEN 3
70           WHEN importance='regional' THEN 4
71           WHEN importance='national' THEN 5
72           WHEN importance='international' THEN 6 END)] as importance,
73         route,
74         (array['forward', 'backward', 'both'])[bit_or(CASE
75           WHEN role[1]='forward' THEN 1
76           WHEN role[1]='backward' THEN 2
77           ELSE 3
78         END)] as dir,
79         'single' as tracks,
80          (CASE WHEN "tunnel" in ('yes', 'true', '1') THEN 'yes' ELSE 'no' END) as tunnel,
81          (CASE
82            WHEN "highway" in ('unclassified', 'road', 'residential') THEN 'minor'
83            WHEN "highway" in ('living_street', 'pedestrian', 'byway') THEN 'pedestrian'
84            WHEN "highway" in ('service', 'bus_guideway') THEN 'service'
85            WHEN "highway" in ('primary', 'secondary', 'tertiary') THEN "highway"
86            WHEN "highway" in ('path', 'cycleway', 'footway', 'bridleway', 'steps') THEN 'path'
87            WHEN "railway" in ('tram', 'light_rail', 'narrow_gauge') THEN 'tram'
88            WHEN "railway" in ('rail', 'subway', 'preserved', 'monorail') THEN 'rail'
89            ELSE "highway" END) as highway_type
90       from planet_osm_line_route
91       where route in ('train', 'rail', 'railway', 'subway', 'ferry')
92       group by way, tunnel, highway_type, route
93       ) as routes
94      </Parameter>
95      <Parameter name="estimate_extent">false</Parameter>
96      <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
97    </Datasource>
98   </Layer>
99   <Layer class="routes_features" name="routes" 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">
100    <Datasource>
101      <Parameter name="type">postgis</Parameter>
102      <Parameter name="dbname">__DBNAME__</Parameter>
103      <Parameter name="table">
104      (select way,
105         (array['local', 'suburban', 'urban', 'regional', 'national', 'international'])[max(CASE
106           WHEN importance='local' THEN 1
107           WHEN importance='suburban' THEN 2
108           WHEN importance='urban' THEN 3
109           WHEN importance='regional' THEN 4
110           WHEN importance='national' THEN 5
111           WHEN importance='international' THEN 6 END)] as importance,
112         (array['tram', 'bus', 'tram_bus'])[bit_or(CASE
113           WHEN route in ('tram', 'light_rail') THEN 1
114           WHEN route in ('trolley', 'bus', 'minibus') THEN 2
115           END)] as route,
116         (array['forward', 'backward', 'both'])[bit_or(CASE
117           WHEN role[1]='forward' THEN 1
118           WHEN role[1]='backward' THEN 2
119           ELSE 3
120         END)] as dir,
121          (array['single', 'double'])[bit_or(CASE
122            WHEN "route" in ('trolley', 'bus', 'minibus') THEN
123              (CASE
124                WHEN "oneway" in ('yes', 'true', '1') THEN 1
125                ELSE 2 END)
126            WHEN "route" in ('tram', 'light_rail') THEN
127              (CASE
128                WHEN "tracks" in ('1', 'single') THEN 1
129                ELSE 2 END)
130            ELSE
131              (CASE
132                WHEN "tracks" in ('2', 'double') THEN 2
133                ELSE 1 END) END)] as tracks,
134          (CASE WHEN "tunnel" in ('yes', 'true', '1') THEN 'yes' ELSE 'no' END) as tunnel,
135          (CASE
136            WHEN "highway" in ('unclassified', 'road', 'residential') THEN 'minor'
137            WHEN "highway" in ('living_street', 'pedestrian', 'byway') THEN 'pedestrian'
138            WHEN "highway" in ('service', 'bus_guideway') THEN 'service'
139            WHEN "highway" in ('primary', 'secondary', 'tertiary') THEN "highway"
140            WHEN "highway" in ('path', 'cycleway', 'footway', 'bridleway', 'steps') THEN 'path'
141            WHEN "railway" in ('tram', 'light_rail', 'narrow_gauge') THEN 'tram'
142            WHEN "railway" in ('rail', 'subway', 'preserved', 'monorail') THEN 'rail'
143            ELSE "highway" END) as highway_type
144       from planet_osm_line_route
145       where route in ('trolley', 'bus', 'minibus', 'tram', 'light_rail')
146       group by way, tunnel, highway_type
147       ) as routes
148      </Parameter>
149      <Parameter name="estimate_extent">false</Parameter>
150      <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
151    </Datasource>
152   </Layer>
153   <Layer class="routes_features" name="routes" 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">
154    <Datasource>
155      <Parameter name="type">postgis</Parameter>
156      <Parameter name="dbname">__DBNAME__</Parameter>
157      <Parameter name="table">
158      (select way,
159         (array['local', 'urban', 'regional', 'national', 'international'])[max(CASE
160           WHEN importance='local' THEN 1
161           WHEN importance='suburban' THEN 2
162           WHEN importance='urban' THEN 3
163           WHEN importance='regional' THEN 4
164           WHEN importance='national' THEN 5
165           WHEN importance='international' THEN 6 END)] as importance,
166         (CASE WHEN route in ('train', 'rail', 'railway') THEN 'rail'
167               ELSE "route" END) as route,
168         (array['forward', 'backward', 'both'])[bit_or(CASE
169           WHEN role[1]='forward' THEN 1
170           WHEN role[1]='backward' THEN 2
171           ELSE 3
172         END)] as dir,
173         'single' as tracks,
174          (CASE WHEN "tunnel" in ('yes', 'true', '1') THEN 'yes' ELSE 'no' END) as tunnel,
175          (CASE
176            WHEN "highway" in ('unclassified', 'road', 'residential') THEN 'minor'
177            WHEN "highway" in ('living_street', 'pedestrian', 'byway') THEN 'pedestrian'
178            WHEN "highway" in ('service', 'bus_guideway') THEN 'service'
179            WHEN "highway" in ('primary', 'secondary', 'tertiary') THEN "highway"
180            WHEN "highway" in ('path', 'cycleway', 'footway', 'bridleway', 'steps') THEN 'path'
181            WHEN "railway" in ('tram', 'light_rail', 'narrow_gauge') THEN 'tram'
182            WHEN "railway" in ('rail', 'subway', 'preserved', 'monorail') THEN 'rail'
183            ELSE "highway" END) as highway_type
184       from planet_osm_line_route
185       where route in ('train', 'rail', 'railway', 'subway', 'ferry')
186       group by way, tunnel, highway_type, route
187       ) as routes
188      </Parameter>
189      <Parameter name="estimate_extent">false</Parameter>
190      <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
191    </Datasource>
192   </Layer>
193   <Layer class="stations_bbox" 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">
194    <Datasource>
195      <Parameter name="type">postgis</Parameter>
196      <Parameter name="dbname">__DBNAME__</Parameter>
197      <Parameter name="table">
198        (select name, importance, bbox as way from planet_osm_stations) as stations
199      </Parameter>
200      <Parameter name="estimate_extent">false</Parameter>
201      <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
202    </Datasource>
203   </Layer>
204   <Layer class="stations_all" 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">
205    <Datasource>
206      <Parameter name="type">postgis</Parameter>
207      <Parameter name="dbname">__DBNAME__</Parameter>
208      <Parameter name="table">
209        (select name, importance, way from planet_osm_point where
210  (highway='bus_stop' or railway='tram_stop' or
211    railway='station' or railway='halt' or
212    amenity='bus_station' or aeroway='station' or
213    amenity='ferry_terminal')
214        ) as stations
215      </Parameter>
216      <Parameter name="estimate_extent">false</Parameter>
217      <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
218    </Datasource>
219   </Layer>
220   <Layer class="stops_p" 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">
221    <Datasource>
222      <Parameter name="type">postgis</Parameter>
223      <Parameter name="dbname">__DBNAME__</Parameter>
224      <Parameter name="table">
225        (select angle_p as angle, type, importance, way,
226          (CASE WHEN direction=1 THEN 'forward'
227                WHEN direction=2 THEN 'backward'
228                ELSE 'both' END) as direction from planet_osm_stops
229        ) as stops
230      </Parameter>
231      <Parameter name="estimate_extent">false</Parameter>
232      <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
233    </Datasource>
234   </Layer>
235
236   <Layer class="stops_n" 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">
237    <Datasource>
238      <Parameter name="type">postgis</Parameter>
239      <Parameter name="dbname">__DBNAME__</Parameter>
240      <Parameter name="table">
241        (select angle_n as angle, type, importance, way,
242          (CASE WHEN direction=1 THEN 'forward'
243                WHEN direction=2 THEN 'backward'
244                ELSE 'both' END) as direction from planet_osm_stops
245        ) as stops
246      </Parameter>
247      <Parameter name="estimate_extent">false</Parameter>
248      <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
249    </Datasource>
250   </Layer>
251   <Layer class="stops_o" 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">
252    <Datasource>
253      <Parameter name="type">postgis</Parameter>
254      <Parameter name="dbname">__DBNAME__</Parameter>
255      <Parameter name="table">
256        (select name, (CASE
257          WHEN railway in ('subway_entrance') THEN 'railway_'||"railway"
258          WHEN aeroway in ('aerodrome', 'terminal') THEN 'aeroway_'||"aeroway"
259          WHEN amenity in ('taxi') THEN 'amenity_'||"amenity"
260          WHEN amenity='vending_machine' and vending='public_transport_tickets' THEN 'amenity_pt_tickets'
261        END) as type, way from
262        (select name, railway, aeroway, amenity, vending, way from planet_osm_point
263         union
264         select name, railway, aeroway, amenity, vending, way from planet_osm_polygon) as t
265        where
266          railway in ('subway_entrance') or
267          aeroway in ('aerodrome', 'terminal') or
268          amenity in ('taxi', 'vending_machine')
269        ) as stops
270      </Parameter>
271      <Parameter name="estimate_extent">false</Parameter>
272      <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
273    </Datasource>
274   </Layer>
275
276   <Layer class="stations_center" 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">
277    <Datasource>
278      <Parameter name="type">postgis</Parameter>
279      <Parameter name="dbname">__DBNAME__</Parameter>
280      <Parameter name="table">
281        (select name, importance, center as way from planet_osm_stations) as stations
282      </Parameter>
283      <Parameter name="estimate_extent">false</Parameter>
284      <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
285    </Datasource>
286   </Layer>
287   <Layer class="stations_top" 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">
288    <Datasource>
289      <Parameter name="type">postgis</Parameter>
290      <Parameter name="dbname">__DBNAME__</Parameter>
291      <Parameter name="table">
292        (select name, importance, top as way from planet_osm_stations) as stations
293      </Parameter>
294      <Parameter name="estimate_extent">false</Parameter>
295      <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
296    </Datasource>
297   </Layer>
298   <!-- <Layer class="stations_type" 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">
299    <Datasource>
300      <Parameter name="type">postgis</Parameter>
301      <Parameter name="dbname">__DBNAME__</Parameter>
302      <Parameter name="geometry_field">topline</Parameter>
303      <Parameter name="table">
304        (select distinct t.coll_id, type, st.topline, st.importance from (
305            select cm.coll_id, p.osm_id, 'aeroway_terminal' as type from coll_members cm left join planet_osm_polygon p on cm.member_id=p.osm_id and cm.member_type=2 where aeroway='terminal'
306          union
307            select cm.coll_id, p.osm_id, 'aeroway_terminal' as type from coll_members cm left join planet_osm_point p on cm.member_id=p.osm_id and cm.member_type=1 where aeroway='terminal'
308          union
309            select cm.coll_id, p.osm_id, 'amenity_'||"amenity" as type from coll_members cm left join planet_osm_polygon p on cm.member_id=p.osm_id and cm.member_type=2 where amenity in ('ferry_terminal', 'bus_station')
310          union
311            select cm.coll_id, p.osm_id, 'amenity_'||"amenity" as type from coll_members cm left join planet_osm_point p on cm.member_id=p.osm_id and cm.member_type=1 where amenity in ('ferry_terminal', 'bus_station')
312          union
313            select cm.coll_id, p.osm_id, 'aerialway_station' as type from coll_members cm left join planet_osm_point p on cm.member_id=p.osm_id and cm.member_type=1 where aerialway='station'
314          union
315            select cm.coll_id, p.osm_id, 'railway_'||"railway" as type from coll_members cm left join planet_osm_polygon p on cm.member_id=p.osm_id and cm.member_type=2 where railway in ('station', 'subway_station')
316          union
317            select cm.coll_id, p.osm_id, 'railway_'||"railway" as type from coll_members cm left join planet_osm_point p on cm.member_id=p.osm_id and cm.member_type=1 where railway in ('station', 'subway_station', 'halt', 'tram_stop')
318          union
319            select cm.coll_id, p.osm_id, 'highway_bus_stop' as type from coll_members cm left join planet_osm_point p on cm.member_id=p.osm_id and cm.member_type=1 where highway='bus_stop'
320          ) as t left join planet_osm_stations st on t.coll_id=st.coll_id
321         
322          union
323
324        select distinct t.relation_id, type, st.topline, st.importance from (
325            select cm.relation_id, p.osm_id, 'aeroway_terminal' as type from relation_members cm left join planet_osm_polygon p on cm.member_id=p.osm_id and cm.member_type=2 where aeroway='terminal'
326          union
327            select cm.relation_id, p.osm_id, 'aeroway_terminal' as type from relation_members cm left join planet_osm_point p on cm.member_id=p.osm_id and cm.member_type=1 where aeroway='terminal'
328          union
329            select cm.relation_id, p.osm_id, 'amenity_'||"amenity" as type from relation_members cm left join planet_osm_polygon p on cm.member_id=p.osm_id and cm.member_type=2 where amenity in ('ferry_terminal', 'bus_station')
330          union
331            select cm.relation_id, p.osm_id, 'amenity_'||"amenity" as type from relation_members cm left join planet_osm_point p on cm.member_id=p.osm_id and cm.member_type=1 where amenity in ('ferry_terminal', 'bus_station')
332          union
333            select cm.relation_id, p.osm_id, 'aerialway_station' as type from relation_members cm left join planet_osm_point p on cm.member_id=p.osm_id and cm.member_type=1 where aerialway='station'
334          union
335            select cm.relation_id, p.osm_id, 'railway_'||"railway" as type from relation_members cm left join planet_osm_polygon p on cm.member_id=p.osm_id and cm.member_type=2 where railway in ('station', 'subway_station')
336          union
337            select cm.relation_id, p.osm_id, 'railway_'||"railway" as type from relation_members cm left join planet_osm_point p on cm.member_id=p.osm_id and cm.member_type=1 where railway in ('station', 'subway_station', 'halt', 'tram_stop')
338          union
339            select cm.relation_id, p.osm_id, 'highway_bus_stop' as type from relation_members cm left join planet_osm_point p on cm.member_id=p.osm_id and cm.member_type=1 where highway='bus_stop'
340          ) as t left join planet_osm_stations st on t.relation_id=st.rel_id) as stations
341      </Parameter>
342      <Parameter name="estimate_extent">false</Parameter>
343      <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
344    </Datasource>
345   </Layer> -->
346
347   <Layer class="pt_line" 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">
348    <Datasource>
349      <Parameter name="type">postgis</Parameter>
350      <Parameter name="dbname">__DBNAME__</Parameter>
351      <Parameter name="table">
352      (select
353        osm_id, name, ref,
354        (CASE
355          WHEN "railway" in ('platform') THEN 'railway_'||"railway"
356          END) as type,
357        char_length(ref) as ref_length,
358        way
359      from planet_osm_line
360      where
361        railway in ('platform')
362      ) as t
363      </Parameter>
364      <Parameter name="estimate_extent">false</Parameter>
365      <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
366    </Datasource>
367   </Layer>
368
369   <Layer class="routestext" name="routes-text" 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">
370    <StyleName>routes-text</StyleName>
371    <Datasource>
372      <Parameter name="type">postgis</Parameter>
373      <Parameter name="dbname">__DBNAME__</Parameter>
374      <Parameter name="table">
375      (select route_refs as ref, way, importance, route, tunnel, bridge, highway, railway,
376          (CASE
377            WHEN "highway" in ('unclassified', 'road', 'residential') THEN 'minor'
378            WHEN "highway" in ('living_street', 'pedestrian', 'byway') THEN 'pedestrian'
379            WHEN "highway" in ('service', 'bus_guideway') THEN 'service'
380            WHEN "highway" in ('primary', 'secondary', 'tertiary') THEN "highway"
381            WHEN "railway" in ('tram', 'light_rail', 'narrow_gauge') THEN 'tram'
382            WHEN "railway" in ('rail', 'subway', 'preserved', 'monorail') THEN 'rail'
383            ELSE "highway" END) as highway_type
384 
385      from planet_osm_line_routes_text where route=any(array['train','rail','railway','subway','light_rail','tram','trolley','bus','minibus','ferry'])) as routes
386      </Parameter>
387      <Parameter name="estimate_extent">false</Parameter>
388      <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
389    </Datasource>
390   </Layer>
391
392</Map>
Note: See TracBrowser for help on using the repository browser.