1 | <!DOCTYPE Map>
|
---|
2 | <!-- Sample Mapnik XML template by Dane Springmeyer -->
|
---|
3 | <Map srs="+proj=latlong +datum=WGS84" background-color="white" minimum-version="0.7.2">
|
---|
4 |
|
---|
5 | <Style name="population">
|
---|
6 |
|
---|
7 | <!-- Built from Seven Class sequential YIGnBu from www.colorbrewer.org -->
|
---|
8 | <!-- Quantile breaks originally from QGIS layer classification -->
|
---|
9 | <Rule>
|
---|
10 | <Filter>[pop_est] > -1 and [pop_est] < 15000</Filter>
|
---|
11 | <PolygonSymbolizer fill="#c7e9b4"/>
|
---|
12 | <LineSymbolizer stroke="black" stroke-width=".1"/>
|
---|
13 | </Rule>
|
---|
14 |
|
---|
15 | <Rule>
|
---|
16 | <Filter>[pop_est] >= 15000 and [pop_est] < 255000</Filter>
|
---|
17 | <PolygonSymbolizer fill="#7fcdbb"/>
|
---|
18 | <LineSymbolizer stroke="black" stroke-width=".1"/>
|
---|
19 | </Rule>
|
---|
20 |
|
---|
21 | <Rule>
|
---|
22 | <Filter>[pop_est] >= 255000 and [pop_est] < 1300000</Filter>
|
---|
23 | <PolygonSymbolizer fill="#1d91c0"/>
|
---|
24 | </Rule>
|
---|
25 |
|
---|
26 | <Rule>
|
---|
27 | <Filter>[pop_est] >= 1300000 and [pop_est] < 4320000</Filter>
|
---|
28 | <PolygonSymbolizer fill="#41b6c3"/>
|
---|
29 | </Rule>
|
---|
30 |
|
---|
31 | <Rule>
|
---|
32 | <Filter>[pop_est] >= 4320000 and [pop_est] < 9450000</Filter>
|
---|
33 | <PolygonSymbolizer fill="#225ea8"/>
|
---|
34 | </Rule>
|
---|
35 |
|
---|
36 | <Rule>
|
---|
37 | <Filter>[pop_est] >= 9450000 and [pop_est] < 25650000</Filter>
|
---|
38 | <PolygonSymbolizer fill="#225ea8"/>
|
---|
39 | </Rule>
|
---|
40 |
|
---|
41 | <Rule>
|
---|
42 | <Filter>[pop_est] >= 25650000 and [pop_est] < 1134000000</Filter>
|
---|
43 | <PolygonSymbolizer fill="#122F7F"/>
|
---|
44 | </Rule>
|
---|
45 |
|
---|
46 | <Rule>
|
---|
47 | <ElseFilter/>
|
---|
48 | <!-- This will catch all other values - in this case just India and China -->
|
---|
49 | <!-- A dark red polygon fill and black outline is used here to highlight these two countries -->
|
---|
50 | <PolygonSymbolizer fill="darkred"/>
|
---|
51 | <LineSymbolizer stroke="black" stroke-width=".7"/>
|
---|
52 | </Rule>
|
---|
53 |
|
---|
54 | </Style>
|
---|
55 |
|
---|
56 | <Style name="countries_label">
|
---|
57 | <Rule>
|
---|
58 | <!-- Only label those countries with over 9 Million People -->
|
---|
59 | <!-- Note: Halo and Fill are reversed to try to make them subtle -->
|
---|
60 | <Filter>[pop_est] >= 4320000 and [pop_est] < 9450000</Filter>
|
---|
61 | <TextSymbolizer size="7" fill="black" face-name="DejaVu Sans Bold" halo-fill="#DFDBE3" halo-radius="1" wrap-width="20">[name]</TextSymbolizer>
|
---|
62 | </Rule>
|
---|
63 |
|
---|
64 | <Rule>
|
---|
65 | <!-- Only label those countries with over 9 Million People -->
|
---|
66 | <!-- Note: Halo and Fill are reversed to try to make them subtle -->
|
---|
67 | <Filter>[pop_est] >= 9450000 and [pop_est] < 25650000</Filter>
|
---|
68 | <TextSymbolizer size="9" fill="black" face-name="DejaVu Sans Book" halo-fill="#DFDBE3" halo-radius="1" wrap-width="20">[name]</TextSymbolizer>
|
---|
69 | </Rule>
|
---|
70 |
|
---|
71 | <Rule>
|
---|
72 | <!-- Those with over 25 Million get larger labels -->
|
---|
73 | <Filter>[pop_est] >= 25650000 and [pop_est] < 1134000000</Filter>
|
---|
74 | <TextSymbolizer size="12" fill="white" face-name="DejaVu Sans Book" halo-fill="#2E2F39" halo-radius="1" wrap-width="20">[name]</TextSymbolizer>
|
---|
75 | </Rule>
|
---|
76 |
|
---|
77 | <Rule>
|
---|
78 | <!-- Those with over 25 Million get larger labels -->
|
---|
79 | <!-- Note: allow_overlap is true here to allow India/China to sneak through -->
|
---|
80 | <Filter>[pop_est] >= 1134000000</Filter>
|
---|
81 | <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>
|
---|
82 | </Rule>
|
---|
83 | </Style>
|
---|
84 |
|
---|
85 | <Layer name="countries" srs="+proj=latlong +datum=WGS84" status="on">
|
---|
86 | <!-- Style order determines layering hierarchy -->
|
---|
87 | <!-- Labels go on top so they are listed second -->
|
---|
88 | <StyleName>population</StyleName>
|
---|
89 | <StyleName>countries_label</StyleName>
|
---|
90 | <Datasource>
|
---|
91 | <Parameter name="type">shape</Parameter>
|
---|
92 | <Parameter name="file">/home/user/data/natural_earth2/ne_10m_admin_0_countries.shp</Parameter>
|
---|
93 | </Datasource>
|
---|
94 | </Layer>
|
---|
95 |
|
---|
96 | </Map>
|
---|