-
Notifications
You must be signed in to change notification settings - Fork 3
/
mapnik_population.xml
93 lines (80 loc) · 3.71 KB
/
mapnik_population.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
<!DOCTYPE Map>
<!-- Sample Mapnik XML template by Dane Springmeyer -->
<Map srs="+proj=latlong +datum=WGS84" background-color="white" minimum-version="0.7.2">
<Style name="population">
<!-- Built from Seven Class sequential YIGnBu from www.colorbrewer.org -->
<!-- Quantile breaks originally from QGIS layer classification -->
<Rule>
<Filter>[POP2005] > -1 and [POP2005] < 15000</Filter>
<PolygonSymbolizer fill="#c7e9b4"/>
<LineSymbolizer stroke="black" stroke-width=".1"/>
</Rule>
<Rule>
<Filter>[POP2005] >= 15000 and [POP2005] < 255000</Filter>
<PolygonSymbolizer fill="#7fcdbb"/>
<LineSymbolizer stroke="black" stroke-width=".1"/>
</Rule>
<Rule>
<Filter>[POP2005] >= 255000 and [POP2005] < 1300000</Filter>
<PolygonSymbolizer fill="#1d91c0"/>
</Rule>
<Rule>
<Filter>[POP2005] >= 1300000 and [POP2005] < 4320000</Filter>
<PolygonSymbolizer fill="#41b6c3"/>
</Rule>
<Rule>
<Filter>[POP2005] >= 4320000 and [POP2005] < 9450000</Filter>
<PolygonSymbolizer fill="#225ea8"/>
</Rule>
<Rule>
<Filter>[POP2005] >= 9450000 and [POP2005] < 25650000</Filter>
<PolygonSymbolizer fill="#225ea8"/>
</Rule>
<Rule>
<Filter>[POP2005] >= 25650000 and [POP2005] < 1134000000</Filter>
<PolygonSymbolizer fill="#122F7F"/>
</Rule>
<Rule>
<ElseFilter/>
<!-- This will catch all other values - in this case just India and China -->
<!-- A dark red polygon fill and black outline is used here to highlight these two countries -->
<PolygonSymbolizer fill="darkred"/>
<LineSymbolizer stroke="black" stroke-width=".7"/>
</Rule>
</Style>
<Style name="countries_label">
<Rule>
<!-- Only label those countries with over 9 Million People -->
<!-- Note: Halo and Fill are reversed to try to make them subtle -->
<Filter>[POP2005] >= 4320000 and [POP2005] < 9450000</Filter>
<TextSymbolizer size="7" fill="black" face-name="DejaVu Sans Bold" halo-fill="#DFDBE3" halo-radius="1" wrap-width="20">[NAME]</TextSymbolizer>
</Rule>
<Rule>
<!-- Only label those countries with over 9 Million People -->
<!-- Note: Halo and Fill are reversed to try to make them subtle -->
<Filter>[POP2005] >= 9450000 and [POP2005] < 25650000</Filter>
<TextSymbolizer size="9" fill="black" face-name="DejaVu Sans Book" halo-fill="#DFDBE3" halo-radius="1" wrap-width="20">[NAME]</TextSymbolizer>
</Rule>
<Rule>
<!-- Those with over 25 Million get larger labels -->
<Filter>[POP2005] >= 25650000 and [POP2005] < 1134000000</Filter>
<TextSymbolizer size="12" fill="white" face-name="DejaVu Sans Book" halo-fill="#2E2F39" halo-radius="1" wrap-width="20">[NAME]</TextSymbolizer>
</Rule>
<Rule>
<!-- Those with over 25 Million get larger labels -->
<!-- Note: allow_overlap is true here to allow India/China to sneak through -->
<Filter>[POP2005] >= 1134000000</Filter>
<TextSymbolizer size="15" fill="white" face-name="DejaVu Sans Book" halo-fill="black" halo-radius="1" wrap-width="20" allow-overlap="true" avoid-edges="true">[NAME]</TextSymbolizer>
</Rule>
</Style>
<Layer name="countries" srs="+proj=latlong +datum=WGS84" status="on">
<!-- Style order determines layering hierarchy -->
<!-- Labels go on top so they are listed second -->
<StyleName>population</StyleName>
<StyleName>countries_label</StyleName>
<Datasource>
<Parameter name="type">shape</Parameter>
<Parameter name="file">data/world_borders/TM_WORLD_BORDERS-0.3.shp</Parameter>
</Datasource>
</Layer>
</Map>