Scale Range Denominator
The scale range denominator indicates the map scale at a specific zoom level. In Mango, the scale range begins at zoom level 0 (the whole world) = scale 1:443744032, and ends at zoom level 22 (a tree) = scale 1:106.
This denominator can be used in Custom SLD to create scale dependent styling, either through scale ranges defined through one or more Rules, or using Functions that reference the scale denominator.
Here are two example of referencing scale
Example: Categorising label font size over the scale range.
- At scales greater than 1:433344 (zoom levels 0 to 10), the label font size will be 8px.
- At scales less than or equal to 1:13542 (zoom levels 15 to 20) the label font size will be 12px.
- Between 11 to 14 inclusive, the label font size will be 10px.
<Rule>
...
<CssParameter name="font-size"> <ogc:Function name="Categorize"> <ogc:Function name="env"> <ogc:Literal>wms_scale_denominator</ogc:Literal> </ogc:Function> <ogc:Literal>12</ogc:Literal> <ogc:Literal>13542</ogc:Literal> <ogc:Literal>10</ogc:Literal> <ogc:Literal>433344</ogc:Literal> <ogc:Literal>8</ogc:Literal> </ogc:Function> </CssParameter>
...
</Rule>
Example: Using two rules to change the symbology
- At scales greater than 1:433344 (zoom levels 0 to 10), the marker will be a red square.
- At scales less than 1:433344 (zoom levels 10 to 20), the marker will be a green triangle.
<Rule> <MaxScaleDenominator>433344</MaxScaleDenominator> <PointSymbolizer> <Graphic> <Mark> <WellKnownName>square</WellKnownName> <Fill><CssParameter name="fill">#FF0000</CssParameter> </Mark> <Size>10</Size> </Graphic> </PointSymbolizer> </Rule> <Rule> <MinScaleDenominator>433344</MinScaleDenominator> <PointSymbolizer> <Graphic> <Mark> <WellKnownName>triangle</WellKnownName> <Fill><CssParameter name="fill">#0000FF</CssParameter> </Mark> <Size>4</Size> </Graphic> </PointSymbolizer> </Rule>
Note that the above examples are not complete SLD.
Scale range denominator reference table
Zoom Level | Scale Range Denominator |
---|---|
0 | 443744032 |
1 | 221872016 |
2 | 110936008 |
3 | 55468004 |
4 | 27734002 |
5 | 13867001 |
6 | 6933501 |
7 | 3466750 |
8 | 1733375 |
9 | 866688 |
10 | 433344 |
11 | 216672 |
12 | 108336 |
13 | 54168 |
14 | 27084 |
15 | 13542 |
16 | 6771 |
17 | 3385 |
18 | 1693 |
19 | 846 |
20 | 423 |
21 | 212 |
22 | 106 |
Relative scales
Zoom Level
|
Tile width (per 256px tile at equator) | Screen scale (at equator) | |
---|---|---|---|
Degrees (°) of longitude | m per pixel | feet per pixel | |
0 | 360 | 156,543 | 513,593 |
1 | 180 | 78,272 | 256,796 |
2 | 90 | 39,136 | 128,398 |
3 | 45 | 19,568 | 64,199 |
4 | 22.5 | 9,784 | 32,100 |
5 | 11.3 | 4,892 | 16,050 |
6 | 5.63 | 2,446 | 8,025 |
7 | 2.81 | 1,223 | 4,012 |
8 | 1.41 | 611 | 2,006 |
9 | 0.70 | 306 | 1,003 |
10 | 0.35 | 153 | 502 |
11 | 0.18 | 76 | 251 |
12 | 0.09 | 38 | 125 |
13 | 0.04 | 19 | 63 |
14 | 0.02 | 10 | 31 |
15 | 0.01 | 5 | 16 |
16 | 0.005 | 2.4 | 8 |
17 | 0.003 | 1.2 | 4 |
18 | 0.0014 | 0.60 | 2 |
19 | 0.0007 | 0.30 | 1 |
20 | 0.00034 | 0.15 | 0.5 |
21 | 0.00017 | 0.07 | 0.24 |
22 | 0.00009 | 0.04 | 0.12 |
Tile matrix
Zoom Level | Area of View | Tile Matrix | Number of tiles required for global coverage | Data Storage |
---|---|---|---|---|
0 | Whole world | 1² | 1 | 15 KB |
1 | 2² | 4 | 60 KB | |
2 | 4² | 16 | 240 KB | |
3 | 8² | 64 | 960 KB | |
4 | Contiguous USA | 16² | 256 | 4 MB |
5 | 32² | 1,024 | 16 MB | |
6 | 64² | 4,096 | 62 MB | |
7 | State | 128² | 16,384 | 246 MB |
8 | 256² | 65,536 | 984 MB | |
9 | 512² | 262,144 | 4 GB | |
10 | City | 1024² | 1,048,576 | 16 GB |
11 | 2048² | 4,194,304 | 63 GB | |
12 | 4096² | 16,777,216 | 252 GB | |
13 | Suburb | 8192² | 67,108,864 | 2 TB |
14 | 16384² | 268,435,456 | 5 TB | |
15 | 32768² | 1,073,741,824 | 17 TB | |
16 | Village | 65536² | 4,294,967,296 | 65 TB |
17 | 131072² | 17,179,869,184 | 258 TB | |
18 | 262144² | 68,719,476,736 | 2 PB | |
19 | Neighbourhood | 524288² | 274,877,906,944 | 5 PB |
20 | 1048576² | 1,099,511,627,776 | 17 PB | |
21 | Building | 2097152² | 4,398,046,511,104 | 66 PB |
22 | Tree | 4194304² | 17,592,186,044,416 | 264 PB |