source: subversion/applications/rendering/toposm/labels.xml.templ @ 24241

Last change on this file since 24241 was 24241, checked in by ahlzen, 9 years ago

Minor adjustments to contour labels.

File size: 13.4 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<!DOCTYPE Map[
3    <!ENTITY % utils SYSTEM "include/utils.inc">
4    <!ENTITY % colors SYSTEM "include/colors.inc">
5        <!ENTITY dbsettings SYSTEM "include/dbsettings.inc">
6        <!ENTITY extents SYSTEM "include/extents.inc">
7        <!ENTITY extentsLatLon SYSTEM "include/extentsLatLon.inc">
8        <!ENTITY symbolsdir "geodata/osm/symbols">
9        <!ENTITY customsymbolsdir "custom-symbols">
10        %utils;
11        %colors;
12]>
13
14<Map bgcolor="&landcolor;" srs="&srs900913;">
15
16<!-- NHD ftype
17336 = canal, ditch
18390 = lake, pond
19428 = pipeline
20436 = reservoir
21460 = stream, river
22466 = swamp, marsh
23-->
24
25<Style name="nhdflowline">
26        <Rule>
27                &minz12;
28                &maxz13;
29                <Filter>
30                    ([ftype] = 460 or [ftype] = 336 or [ftype] = 428)
31            and [lengthkm] &gt; 2
32                </Filter>
33                <TextSymbolizer name="gnis_name" face_name="DejaVu Sans Book" size="9" fill="&waterlinecolor;" placement="line" max_char_angle_delta="35"/>
34        </Rule>
35        <Rule>
36                &minz14;
37                <Filter>
38                        [ftype] = 460 or [ftype] = 336 or [ftype] = 428
39                </Filter>
40                <TextSymbolizer name="gnis_name" face_name="DejaVu Sans Book" size="10" fill="&waterlinecolor;" placement="line" max_char_angle_delta="35"/>
41        </Rule>
42</Style>
43
44<Style name="nhdarea">
45    <Rule>
46                &minz10;
47                &maxz11;
48            <Filter>
49                ([ftype] = 460 or [ftype] = 436 or [ftype] = 460 or [ftype] = 466)
50                and [areasqkm] &gt; 4
51        </Filter>
52        <TextSymbolizer name="gnis_name" face_name="DejaVu Sans Oblique" size="10" fill="&waterlinecolor;" dy="0" wrap_width="0"/>
53        </Rule>
54        <Rule>
55                &minz12;
56                &maxz13;
57            <Filter>
58                ([ftype] = 460 or [ftype] = 436 or [ftype] = 460 or [ftype] = 466)
59                and [areasqkm] &gt; 1
60        </Filter>
61        <TextSymbolizer name="gnis_name" face_name="DejaVu Sans Oblique" size="10" fill="&waterlinecolor;" dy="0" wrap_width="0"/>
62        </Rule>
63        <Rule>
64                &minz14;
65            <Filter>
66                [ftype] = 460 or [ftype] = 436 or [ftype] = 460 or [ftype] = 466
67        </Filter>
68        <TextSymbolizer name="gnis_name" face_name="DejaVu Sans Oblique" size="11" fill="&waterlinecolor;" dy="0" wrap_width="0"/>
69        </Rule>
70</Style>
71
72<Style name="statenames">
73    <Rule>
74      <Filter>[place] = 'state'</Filter>
75      &minz4; &maxz4;
76      <TextSymbolizer name="ref" face_name="DejaVu Sans Book"
77        size="10" fill="#640" dy="0" wrap_width="0"/>
78    </Rule>
79    <Rule>
80      <Filter>[place] = 'state'</Filter>
81      &minz5; &maxz5;
82      <TextSymbolizer name="name" face_name="DejaVu Sans Book"
83        size="12" fill="#640" dy="0" wrap_width="0"/>
84    </Rule>
85    <Rule>
86      <Filter>[place] = 'state'</Filter>
87      &minz6; &maxz7;
88      <TextSymbolizer name="name" face_name="DejaVu Sans Book"
89        size="14" fill="#640" dy="0" wrap_width="0"/>
90    </Rule>
91</Style>
92
93
94<Style name="placenames">
95        <Rule>
96      &minz5; &maxz7;
97      <Filter>[place] = 'city'</Filter>
98      <TextSymbolizer name="name" face_name="DejaVu Sans Book" size="9" fill="#000" dy="0" wrap_width="0"/>
99    </Rule>
100        <Rule>
101      &minz8; &maxz9;
102      <Filter>[place] = 'city'</Filter>
103      <TextSymbolizer name="name" face_name="DejaVu Sans Condensed Bold" size="10" fill="#000" dy="0" wrap_width="0"/>
104    </Rule>
105    <Rule>
106      &minz10;
107      <Filter>[place] = 'city'</Filter>
108      <TextSymbolizer name="name" face_name="DejaVu Sans Condensed Bold" size="17" fill="#000" dy="0" wrap_width="0"/>
109    </Rule>
110   
111    <Rule>
112      &minz8; &maxz9;
113      <Filter>[place] = 'town'</Filter>
114      <TextSymbolizer name="name" face_name="DejaVu Sans Book" size="9" fill="#000" dy="0" wrap_width="0"/>
115    </Rule>
116    <Rule>
117      &minz10; &maxz10;
118      <Filter>[place] = 'town' or [place] = 'suburb'</Filter>
119      <TextSymbolizer name="name" face_name="DejaVu Sans Condensed Bold" size="10" fill="#000" dy="0" wrap_width="0"/>
120    </Rule>
121    <Rule>
122      &minz11;
123      <Filter>[place] = 'town' or [place] = 'suburb'</Filter>
124      <TextSymbolizer name="name" face_name="DejaVu Sans Condensed Bold" size="13" fill="#000" dy="0" wrap_width="0"/>
125    </Rule>
126   
127    <Rule>
128      &minz11; &maxz12;
129      <Filter>
130                [place] = 'village'
131      </Filter>
132      <TextSymbolizer name="name" face_name="DejaVu Sans Condensed Bold" size="10" fill="#000" dy="0" wrap_width="0"/>
133    </Rule>
134    <Rule>
135      &minz13;
136      <Filter>
137                [place] = 'village'
138      </Filter>
139      <TextSymbolizer name="name" face_name="DejaVu Sans Condensed Bold" size="12" fill="#000" dy="0" wrap_width="0"/>
140    </Rule>
141   
142    <Rule>
143      &minz13;
144      <Filter>
145                [place] = 'locality' or [place] = 'hamlet'
146      </Filter>
147      <TextSymbolizer name="name" face_name="DejaVu Sans Condensed Bold" size="10" fill="#000" dy="0" wrap_width="0"/>
148    </Rule>
149   
150    <Rule>
151        &minz13;
152        &maxz13;
153        <Filter>
154          [place] = 'island'
155        </Filter>
156        <TextSymbolizer name="name" face_name="DejaVu Sans Oblique" size="10" fill="#050" dy="0" wrap_width="0"/>
157    </Rule>
158    <Rule>
159        &minz14;
160        <Filter>
161          [place] = 'island'
162        </Filter>
163        <TextSymbolizer name="name" face_name="DejaVu Sans Oblique" size="11" fill="#050" dy="0" wrap_width="0"/>
164    </Rule>
165</Style>
166
167<Style name="featurenames">
168    <Rule>
169      &minz14;
170      <Filter>
171                [natural] = 'peak'
172      </Filter>
173      <TextSymbolizer name="name" face_name="DejaVu Sans Book" size="11" fill="&contourcolor;" dy="10" wrap_width="100"/>
174      <TextSymbolizer name="ele_w_unit" face_name="DejaVu Sans Book" size="10" fill="&contourcolor;" dy="22" wrap_width="100"/>
175    </Rule>
176    <Rule>
177      &minz13;
178      <Filter>[aeroway] = 'aerodrome'</Filter>
179      <TextSymbolizer name="name" face_name="DejaVu Sans Book" size="10" fill="&transportationcolor;" dy="10" wrap_width="150"/>
180    </Rule>
181    <Rule>
182        &minz15;
183        <Filter>[railway] = 'station'</Filter>
184        <TextSymbolizer name="name" face_name="DejaVu Sans Book" size="10" fill="&transportationcolor;" dy="10" wrap_width="150"/> />
185    </Rule>
186   
187    <Rule>
188        &minz11; &maxz11;
189        <Filter>
190          ([natural] = 'wood' or
191          [landuse] = 'conservation' or
192          [landuse] = 'recreation_ground' or
193              [leisure] = 'recreation_ground' or
194          [landuse] = 'forest')
195          and [way_area] &gt; 20000000
196        </Filter>
197        <TextSymbolizer name="name" face_name="DejaVu Sans Oblique" size="9"
198            fill="#050" dy="0" wrap_width="0"/>
199    </Rule>
200    <Rule>
201        &minz12; &maxz12; <!-- large nature areas -->
202        <Filter>
203          ([natural] = 'wood' or
204          [landuse] = 'conservation' or
205          [landuse] = 'recreation_ground' or
206              [leisure] = 'recreation_ground' or
207          [landuse] = 'forest')
208          and [way_area] &gt; 2000000
209        </Filter>
210        <TextSymbolizer name="name" face_name="DejaVu Sans Oblique" size="9"
211            fill="#050" dy="0" wrap_width="0"/>
212    </Rule>
213    <Rule>
214        &minz13; &maxz13; <!-- medium nature areas -->
215        <Filter>
216          ([natural] = 'wood' or
217          [landuse] = 'conservation' or
218          [landuse] = 'recreation_ground' or
219              [leisure] = 'recreation_ground' or
220          [landuse] = 'forest')
221          and [way_area] &gt; 200000
222        </Filter>
223        <TextSymbolizer name="name" face_name="DejaVu Sans Oblique" size="10"
224            fill="#050" dy="0" wrap_width="0"/>
225    </Rule>
226    <Rule>
227        &minz14; <!-- all nature areas -->
228        <Filter>
229          [natural] = 'wood' or
230          [landuse] = 'conservation' or
231          [landuse] = 'recreation_ground' or
232              [leisure] = 'recreation_ground' or
233          [landuse] = 'forest'
234        </Filter>
235        <TextSymbolizer name="name" face_name="DejaVu Sans Oblique" size="11"
236            fill="#050" dy="0" wrap_width="0"/>
237    </Rule>
238</Style>
239
240
241<!--
242<Style name="areanames">
243  <Rule>
244    &minz13;
245    &maxz13;
246    <Filter>
247      [place] = 'island' or
248      [natural] = 'wood' or
249      [landuse] = 'conservation' or
250      [landuse] = 'recreation_ground' or
251          [leisure] = 'recreation_ground' or
252      [landuse] = 'forest'
253    </Filter>
254    <TextSymbolizer name="name" face_name="DejaVu Sans Oblique" size="10" fill="#050" dy="0" wrap_width="0"/>
255  </Rule>
256  <Rule>
257    &minz14;
258    <Filter>
259      [place] = 'island' or
260      [natural] = 'wood' or
261      [landuse] = 'conservation' or
262      [landuse] = 'recreation_ground' or
263          [leisure] = 'recreation_ground' or
264      [landuse] = 'forest'
265    </Filter>
266    <TextSymbolizer name="name" face_name="DejaVu Sans Oblique" size="11" fill="#050" dy="0" wrap_width="0"/>
267  </Rule>
268</Style>
269-->
270
271<!--
272<Style name="linenames">
273  <Rule>
274          &minz14;
275      <Filter>
276                [waterway] = 'river' or
277        [waterway] = 'canal' or
278                [waterway] = 'stream'
279      </Filter>
280      <TextSymbolizer name="name" face_name="DejaVu Sans Book" size="9" fill="&waterlinecolor;" placement="line" max_char_angle_delta="35"/>
281    </Rule>
282</Style>
283-->
284
285<Style name="major-streetnames">
286    <Rule>
287          &minz13;
288      <Filter>
289        [highway] = 'motorway' or
290        [highway] = 'trunk'
291      </Filter>
292      <TextSymbolizer name="name" face_name="DejaVu Sans Book" size="11" fill="black" spacing="300" placement="line" max_char_angle_delta="35"/>
293    </Rule>
294    <Rule>
295          &minz14;
296      <Filter>
297        [highway] = 'primary' or
298        [highway] = 'secondary' or
299        [highway] = 'tertiary'
300      </Filter>
301      <TextSymbolizer name="name" face_name="DejaVu Sans Book" size="10" fill="black" spacing="300" placement="line" max_char_angle_delta="35"/>
302    </Rule>
303</Style>
304
305<Style name="minor-streetnames">
306    <Rule>
307      &minz15;
308      <Filter>
309        [highway] = 'residential' or
310        [highway] = 'unclassified' or
311        [highway] = 'track' or
312        [highway] = 'path' or
313        [highway] = 'cycleway' or
314        [highway] = 'footway' or
315        [highway] = 'service' or
316        [highway] = 'proposed'
317      </Filter>
318      <TextSymbolizer name="name" face_name="DejaVu Sans Book" size="9" fill="black" spacing="300" placement="line" max_char_angle_delta="45"/>
319    </Rule>
320</Style>
321
322<!-- Layers -->
323
324<Layer name="statenames" status="on">
325    <StyleName>statenames</StyleName>
326    <Datasource>
327                &dbsettings; &extents;
328                <!-- HACK: postgres converts elevation m -> ft, and appends unit -->
329                <Parameter name="table">
330                (SELECT way, place, name, ref FROM ${DB_PREFIX}_point
331                WHERE place = 'state') AS statenames
332                </Parameter>
333    </Datasource>
334</Layer>
335
336<Layer name="placenames" status="on">
337    <StyleName>placenames</StyleName>
338    <Datasource>
339        &dbsettings; &extents;
340        <Parameter name="table">
341            (SELECT way, name, place,
342                    CASE WHEN place = 'city' THEN 2
343                         WHEN place = 'town' THEN 4
344                         WHEN place = 'suburb' THEN 5
345                         WHEN place = 'village' THEN 6
346                         WHEN place = 'hamlet' THEN 7
347                         WHEN place = 'island' THEN 8
348                         WHEN place = 'locality' THEN 9
349                         ELSE 10
350                     END AS place_order
351             FROM ${DB_PREFIX}_point
352             WHERE place IS NOT NULL AND name IS NOT NULL
353             ORDER BY place_order) AS placenames
354        </Parameter>
355    </Datasource>
356</Layer>
357
358<Layer name="pointfeaturenames" status="on">
359    <StyleName>featurenames</StyleName>
360    <Datasource>
361                &dbsettings; &extents;
362                <!--
363                HACK: postgres converts elevation m -> ft, and appends unit
364                NOTE: The CASE is a workaround for when 'm' is explicitly specified
365                as the unit.
366                -->
367                <Parameter name="table">
368                (SELECT way, name, "natural", aeroway, railway, landuse, leisure, 0 as way_area,
369                    CAST(round((CAST(
370                        (CASE WHEN ele LIKE '%m' THEN substr(ele, 0, length(ele)-1) ELSE ele END)
371                    as numeric) * 3.2787), 0) as varchar(10)) || ' ft' as ele_w_unit
372                 FROM ${DB_PREFIX}_point) AS featurenames
373                </Parameter>
374    </Datasource>
375</Layer>
376
377<Layer name="areafeaturenames" status="on">
378    <StyleName>featurenames</StyleName>
379    <Datasource>
380                &dbsettings; &extents;
381                <Parameter name="table">
382                (SELECT way, name, "natural", aeroway, railway, landuse, leisure,
383                 way_area, '' AS ele_w_unit
384                 FROM ${DB_PREFIX}_polygon ORDER BY z_order, way_area DESC)
385                 AS areafeaturenames</Parameter>
386    </Datasource>
387</Layer>
388
389<!--
390<Layer name="linenames" status="on">
391    <StyleName>linenames</StyleName>
392    <Datasource>
393                &dbsettings;
394                &extents;
395                <Parameter name="table">(select * from ${DB_PREFIX}_line order by z_order) as linenames</Parameter>
396    </Datasource>
397</Layer>
398-->
399
400<Layer name="nhdarea" status="on" srs="&srsLatLongNAD83;">
401        <StyleName>nhdarea</StyleName>
402        <Datasource>
403                &dbsettings;
404                &extentsLatLon;
405                <Parameter name="table">${NHD_TABLE_PREFIX}_area</Parameter>
406        </Datasource>
407</Layer>
408
409<Layer name="nhdwaterbody" status="on" srs="&srsLatLongNAD83;">
410        <StyleName>nhdarea</StyleName>
411        <Datasource>
412                &dbsettings;
413                &extentsLatLon;
414                <Parameter name="table">${NHD_TABLE_PREFIX}_waterbody</Parameter>
415        </Datasource>
416</Layer>
417
418<Layer name="nhdflowline" status="on" srs="&srsLatLongNAD83;">
419        <StyleName>nhdflowline</StyleName>
420        <Datasource>
421                &dbsettings;
422                &extentsLatLon;
423                <Parameter name="table">${NHD_TABLE_PREFIX}_flowline</Parameter>
424        </Datasource>
425</Layer>
426
427<Layer name="major-streetnames" status="on">
428    <StyleName>major-streetnames</StyleName>
429    <Datasource>
430                &dbsettings; &extents;
431                <Parameter name="table">
432                (SELECT * FROM ${DB_PREFIX}_roads ORDER BY z_order) AS streetnames
433                </Parameter>
434    </Datasource>
435</Layer>
436
437<Layer name="minor-streetnames" status="on">
438    <StyleName>minor-streetnames</StyleName>
439    <Datasource>
440                &dbsettings; &extents;
441                <Parameter name="table">
442                (SELECT * FROM ${DB_PREFIX}_line ORDER BY z_order) AS streetnames
443                </Parameter>
444    </Datasource>
445</Layer>
446
447</Map>
Note: See TracBrowser for help on using the repository browser.