CartoLab Academic Reference Manual
Mathematical formulations, theoretical foundations, and verified literature for all 13 Processing algorithms and 5 advanced Layout Studio systems. Version 2.8.6.
This manual provides the complete theoretical apparatus behind every algorithm and layout engine in PlanX CartoLab. Each entry supplies the mathematical derivation, parameter semantics, interpretative guidance, and peer-reviewed references. All equations are typeset with MathJax 3.
1. Advanced Classification (GIC / Head-Tail / Fisher-Jenks)
Theoretical Background
Classification is the fundamental cartographic operation that assigns continuous data values to discrete visual classes. The choice of classification method profoundly influences the map reader's perception of spatial pattern. Traditional equal-interval or quantile methods often fail for urban datasets that exhibit strong positive skew, power-law tails, or multimodal distributions. This algorithm implements three complementary approaches that together cover the principal distributional forms encountered in planning and demographic data.
The Adaptive Geometric Interval Classification (GIC) fits a geometric series $C_k = a \cdot r^k$ to the data, optimising the ratio $r$ and scale $a$ to minimise the sum of squared deviations between observed class frequencies and the expected mean frequency $\bar{f} = n/K$. The method performs a coarse-then-fine grid search over feasible $r$ values, using a shift parameter to handle datasets containing zero or negative values. GIC is particularly effective for variables such as population density, land value, and building height, where the distribution is approximately log-normal.
Head/Tail Breaks (Jiang, 2013) recursively partitions the data at the arithmetic mean, retaining the head (values above the mean) for further subdivision. The recursion terminates when the head is no longer "heavy-tailed"—defined as fewer than 2 items or less than 40% (head proportion ≥ 80%) of the current subset. This method is designed for data with a heavy-tailed or power-law distribution, common in city size hierarchies, traffic flows, and income data. Unlike arbitrary class counts, Head/Tail Breaks determines the number of classes from the data structure. Fisher-Jenks Natural Breaks (Jenks, 1967; Fisher, 1958) uses dynamic programming to minimise the sum of within-class variances. For $n > 5000$ observations, the algorithm automatically samples to maintain performance while preserving distributional fidelity.
Mathematical Formulation
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Input layer | Vector (any geometry) | — | Layer containing the field to classify |
| Field to classify | Numeric field | — | Must be integer or real; NULL values are excluded |
| Number of classes | Integer | 5 | Range 2–20; Head/Tail Breaks ignores this and auto-determines |
| Classification method | Enum | GIC | 0 = Geometric Interval, 1 = Head/Tail Breaks, 2 = Fisher-Jenks, 3 = Maximum Breaks, 4 = Pretty Breaks |
| Color ramp | Enum | Viridis | Viridis, Plasma, Inferno, Magma, Cividis, Turbo, Mako, Rocket, Blues, Oranges, YlOrRd, Purples, Greens |
Output Description
The output layer is a copy of the input with two appended fields:
gic_class (integer, 0-indexed class assignment) and
gic_label (string, formatted range label such as
“123.40 – 567.80”). The layer is automatically styled with a
graduated renderer using the chosen colour ramp and clean class-boundary
legend entries.
Interpretation Guide
References
- ESRI. Geometric Interval Classification. ArcGIS Desktop Help: Classification methods. ESRI Technical Paper, 2005.
- Jenks, G. F. The Data Model Concept in Statistical Mapping. International Yearbook of Cartography, 7: 186–190, 1967.
- Fisher, W. D. On Grouping for Maximum Homogeneity. Journal of the American Statistical Association, 53(284): 789–798, 1958. doi:10.1080/01621459.1958.10501479
- Jiang, B. Head/Tail Breaks: A New Classification Scheme for Data with a Heavy-Tailed Distribution. The Professional Geographer, 65(3): 482–494, 2013. doi:10.1080/00330124.2012.700499
- Heckbert, P. S. Nice Numbers for Graph Labels. Graphics Gems, Academic Press, pp. 61–63, 1990.
- Slocum, T. A., McMaster, R. B., Kessler, F. C., & Howard, H. H. Thematic Cartography and Geovisualization (3rd ed.). Pearson, 2009. ISBN 978-0132298346.
2. Bivariate Choropleth Map
Theoretical Background
Bivariate choropleth maps encode the relationship between two spatially coincident variables within a single areal symbolisation. Unlike side-by-side univariate maps, a bivariate matrix forces the reader to perceive co-variation as a single visual gestalt. The technique was formalised by the U.S. Census Bureau in the 1970s and refined by Olson (1981), who demonstrated that spectrally encoded two-variable maps could be read accurately when the colour space is perceptually orthogonal.
The CartoLab implementation classifies each of two numeric fields independently into $N$ bins using the selected method (Geometric Interval or Fisher-Jenks), producing an $N \times N$ grid of cross-classified observations. The colour for each cell $(r, c)$ is computed via bilinear interpolation in RGB space between four user-specified corner colours: Low-Low $(C_{LL})$, Low-High $(C_{LH})$, High-Low $(C_{HL})$, and High-High $(C_{HH})$. This interpolation produces a perceptually smooth colour surface that preserves the logical ordering of both variables. The output layer receives an auto-generated categorised renderer with $N^2$ legend entries, each displaying a swatch from the colour matrix.
The theoretical underpinning draws on colour-order systems developed by Eyton (1984) for complementary-colour maps and Leonowicz (2006) for two-variable choropleth cartography. Care is taken to ensure the diagonal (equal-class cells) is visually coherent and that off-diagonal cells maintain sufficient discriminability. For $N \geq 5$, the matrix produces 25 classes, at which point individual cell discrimination becomes challenging; the recommended grid size is 3 or 4.
Mathematical Formulation
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Input layer | Polygon vector | — | Contains both variables to cross-classify |
| X-axis variable | Numeric field | — | Horizontal axis in the colour matrix |
| Y-axis variable | Numeric field | — | Vertical axis in the colour matrix |
| Grid size | Integer | 3 | $N$ (2–7); produces $N^2$ classes |
| Classification method | Enum | Geometric Interval | Applied independently to both variables |
| 4 corner colours | Colour (RGBA) | teal/gold/blue/copper | User-adjustable LL, LH, HL, HH corner anchors |
Output Description
The output polygon layer carries three new fields: bivar_x_class
(integer, 0-indexed X-axis bin), bivar_y_class (integer, 0-indexed
Y-axis bin), and bivar_class (integer, 0 to $N^2-1$, the composite
colour-matrix cell index). The layer is auto-styled with a categorised renderer
using the $N^2$ bilinearly interpolated colours.
Interpretation Guide
References
- Olson, J. M. Spectrally Encoded Two-Variable Maps. Annals of the Association of American Geographers, 71(2): 259–276, 1981. doi:10.1111/j.1467-8306.1981.tb01352.x
- Eyton, J. R. Complementary-Color Two-Variable Maps. Annals of the Association of American Geographers, 74(3): 477–490, 1984.
- Leonowicz, A. Two-Variable Choropleth Maps as a Useful Tool for Visualization of Geographical Relationship. Geografija, 42(1): 33–37, 2006.
- Brewer, C. A. Designing Better Maps: A Guide for GIS Users (2nd ed.). ESRI Press, 2015. ISBN 978-1589484405.
- Carstensen, L. W. Bivariate Choropleth Mapping: The Effects of Axis Scaling. The American Cartographer, 13(1): 27–41, 1986.
- Dunn, R. A Dynamic Approach to Two-Variable Color Mapping. The American Statistician, 43(4): 245–252, 1989.
- Elmer, M. E. Symbol Considerations for Bivariate Thematic Maps. Cartography and Geographic Information Science, 39(3): 140–150, 2012.
3. Hexbin Aggregation
Theoretical Background
Hexagonal binning is a spatial aggregation technique that partitions a two-dimensional point set into a regular tessellation of regular hexagons. The method was popularised in statistical graphics by Carr et al. (1987) as a solution to overplotting in large scatterplots and later extended to geographical space. Hexagons offer several advantages over square grids: each cell has six equidistant neighbours (versus four orthogonal plus four diagonal for squares), producing smoother density estimates; the circular packing of hexagons reduces sampling bias from edge effects; and the regular tessellation avoids the directional artefacts that rectangular grids can introduce.
The CartoLab implementation uses a pointy-top hexagonal lattice in axial coordinates $(q, r)$, derived from the standard cube-coordinate system $(x, y, z)$ where $x + y + z = 0$. The conversion from geographic coordinates to axial coordinates uses the hexagon circumradius $R$ (distance from centre to vertex). Cube rounding ensures that each point is assigned to the nearest hexagon centre. Unlike some implementations that emit a full grid, CartoLab only emits cells that contain at least one point, conserving output size for sparse datasets.
The method aggregates a user-selectable statistic: count (the number of points falling in each cell), sum (the total of an optional weight field), or mean (sum divided by count). The output hexagons are rendered as flat-topped (rotated 90° from the internal pointy-top computation) for consistency with common cartographic convention. Each hexagon is represented as a regular polygon with six vertices computed at 60° intervals.
Mathematical Formulation
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Input point layer | Point vector | — | Points to bin |
| Hexagon radius | Float | 1000 | Circumradius in map units (CRS-dependent) |
| Weight field | Numeric field (optional) | — | Used for sum and mean statistics |
| Statistic | Enum | Count | 0 = Count, 1 = Sum, 2 = Mean |
Output Description
The output is a polygon layer of regular hexagons. Non-empty cells carry
hex_q and hex_r (axial coordinates),
hex_count (integer, always populated), hex_sum
(weight-field sum, present if sum or mean selected), and hex_mean
(present if mean selected). The layer is auto-graduated with the Viridis colour
ramp on the active statistic field.
Interpretation Guide
References
- Carr, D. B., Littlefield, R. J., Nicholson, W. L., & Littlefield, J. S. Scatterplot Matrix Techniques for Large N. Journal of the American Statistical Association, 82(398): 424–436, 1987. doi:10.1080/01621459.1987.10478445
- Carr, D. B., Olsen, A. R., & White, D. Hexagon Mosaic Maps for Display of Univariate and Bivariate Geographical Data. Cartography and Geographic Information Systems, 19(4): 228–236, 1992. doi:10.1559/152304092783721231
- Birch, C. P. D., Oom, S. P., & Beecham, J. A. Rectangular and Hexagonal Grids Used for Observation, Experiment and Simulation in Ecology. Ecological Modelling, 206(3–4): 347–359, 2007.
- Battersby, S. E., Strebe, D., & Finn, M. P. Shapes on a Plane: Evaluating Hexagonal Binning and Other Tessellation Strategies. Cartographic Perspectives, 85: 27–40, 2017.
- Lewin-Koh, N. Hexagon Binning: An Overview. R package hexbin vignette, 2011.
- Red Blob Games (Patel, A.). Hexagonal Grids. 2013 (revised 2023). Interactive exposition of axial/cube coordinate systems.
- Scott, D. W. Multivariate Density Estimation: Theory, Practice, and Visualization (2nd ed.). Wiley, 2015. ISBN 978-0471697558.
4. Dot-Density Map
Theoretical Background
The dot-density map is one of the oldest thematic mapping techniques, dating to the earliest demographic atlases of the 19th century. Each dot represents a fixed number of units (e.g., one dot = 500 persons), and dots are placed within enumeration areas to convey both the magnitude and the approximate spatial distribution of a phenomenon. Unlike a choropleth map, which forces the reader to infer density from colour intensity across administrative boundaries, a dot-density map shows within-unit variation that can reveal settlement patterns, ecological distributions, and other spatially heterogeneous phenomena.
The CartoLab implementation generates dots via seeded random stratified sampling within each polygon's bounding box, rejecting dots that fall outside the polygon (hole-aware with OGC-compliant point-in-polygon testing). The number of dots per feature is $n_{\text{dots}} = \lfloor v_i / d \rfloor$ where $v_i$ is the count field value and $d$ is the user-specified value per dot. Each feature uses a deterministic pseudo-random seed derived from the user seed and the feature's row index ($\text{seed}_i = \text{seed} \times 1{,}000{,}003 + i$), ensuring reproducible dot placement across runs.
Robinson et al. (1984) recommend limiting dot density to approximately 200 dots/cm² in print to avoid coalescence; for screen display, a lower threshold applies. CartoLab scales $d$ automatically if $n_{\text{dots}}$ would exceed a performance ceiling, and reports the adjustment. Lavin (1986) explored the perceptual accuracy of dot-density maps and found that random placement within enumeration areas is visually acceptable when the dot value is small relative to the feature size, which is the typical use case.
Mathematical Formulation
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Input polygon layer | Polygon vector | — | Enumeration areas containing the count field |
| Count field | Numeric field | — | The magnitude to represent as dots |
| Value per dot | Float | 1 | Each dot represents this many units |
| Random seed | Integer | 42 | Deterministic seed for reproducible placement |
Output Description
The output is a point layer where each dot is a single point geometry. Each dot inherits all attributes from its source polygon, enabling multi-group dot maps (e.g., race/ethnicity categories) by filtering on a category field after generation. No new fields are added to the dot layer beyond the source attributes.
Interpretation Guide
References
- Robinson, A. H., Sale, R. D., Morrison, J. L., & Muehrcke, P. C. Elements of Cartography (6th ed.). Wiley, 1995. ISBN 978-0471555797.
- Lavin, S. J. Mapping Continuous Geographical Distributions Using Dot-Density Shading. The American Cartographer, 13(2): 140–150, 1986.
- Dent, B. D., Torguson, J. S., & Hodler, T. W. Cartography: Thematic Map Design (6th ed.). McGraw-Hill, 2009. ISBN 978-0072943825.
- Mackay, J. R. An Analysis of Isopleth and Dot Maps. Annals of the Association of American Geographers, 45(3): 296–297, 1955.
- Heywood, I., Cornelius, S., & Carver, S. An Introduction to Geographical Information Systems (4th ed.). Pearson, 2011. ISBN 978-0273722595.
- Krygier, J. & Wood, D. Making Maps: A Visual Guide to Map Design for GIS (3rd ed.). Guilford Press, 2016. ISBN 978-1462509980.
5. Continuous-Area Cartogram (Diffusion)
Theoretical Background
A continuous-area cartogram distorts the geometry of enumeration units so that each unit's area is proportional to a selected variable (e.g., population, GDP) while preserving, as far as possible, the contiguity and shape of the original map. The technique has a long pre-computational history but was rendered practical for arbitrary datasets by Gastner and Newman's (2004) diffusion method, which treats the map as a physical medium in which a "density" flows from regions of excess area to regions of deficit until the area error is eliminated.
The CartoLab implementation follows the Gastner–Newman algorithm closely. Each polygon $i$ has a target area $A_i^{\text{target}}$ proportional to its variable value. The current "mass" $m_i$ is defined as the discrepancy between the current equivalent radius and the target radius. A Gaussian-weighted force kernel distributes this mass to neighbouring boundaries, displacing vertices in the direction that reduces area discrepancy. The process iterates until either the mean size error (the ratio of max to min of current and target area) falls below a threshold or the maximum iteration count is reached.
The algorithm employs a spatial hash grid for $\mathcal{O}(n)$ neighbour lookup, replacing the naïve $\mathcal{O}(n^2)$ search. Displacement per iteration is clamped to 30% of the polygon's equivalent radius to prevent topology-breaking jumps. Tobler (2004) reviewed the broader cartogram tradition and placed the diffusion method alongside Dorling's (1996) circular cartograms as the two most computationally tractable approaches.
Mathematical Formulation
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Input polygon layer | Polygon vector | — | Enumeration areas to distort |
| Area-representation field | Numeric field | — | The variable area should represent |
| Max iterations | Integer | 100 | Range 1–200; higher = more precise |
| Max avg error % | Float | 5.0 | Range 0.1–100; halt criterion |
Output Description
The output polygon layer contains the distorted geometries. Two metadata fields
are appended: cartogram_error_pct (the final mean size error,
expressed as a percentage of the target) and the algorithm log reports the number
of iterations actually run. All original attributes are preserved.
Interpretation Guide
References
- Gastner, M. T. & Newman, M. E. J. Diffusion-Based Method for Producing Density-Equalizing Maps. Proceedings of the National Academy of Sciences, 101(20): 7499–7504, 2004. doi:10.1073/pnas.0400280101
- Tobler, W. R. Thirty Five Years of Computer Cartograms. Annals of the Association of American Geographers, 94(1): 58–73, 2004. doi:10.1111/j.1467-8306.2004.09401004.x
- Dorling, D. Area Cartograms: Their Use and Creation. Concepts and Techniques in Modern Geography, 59. University of East Anglia, 1996.
- Gusein-Zade, S. M. & Tikunov, V. S. A New Technique for Constructing Continuous Cartograms. Cartography and Geographic Information Systems, 20(3): 167–173, 1993.
- Dougenik, J. A., Chrisman, N. R., & Niemeyer, D. R. An Algorithm to Construct Continuous Area Cartograms. The Professional Geographer, 37(1): 75–81, 1985.
- Henriques, R., Bação, F., & Lobo, V. Carto-SOM: Cartogram Creation Using Self-Organizing Maps. International Journal of Geographical Information Science, 23(4): 483–511, 2009.
- Nusrat, S. & Kobourov, S. The State of the Art in Cartograms. Computer Graphics Forum, 35(3): 619–642, 2016.
6. Graticule / Reference Grid
Theoretical Background
A graticule is the network of meridians and parallels that provides the coordinate reference frame for a map. Its correct construction is foundational: the spacing, labelling, and visual hierarchy of grid lines directly affect the map reader's ability to locate features and estimate distances. Robinson et al. (1995) devoted a full chapter to the graticule as a map element, emphasising that the interval should be chosen so that the grid is visible but not dominant, typically producing 6–10 lines across the map extent.
The CartoLab implementation generates a vector line layer of meridians and parallels on "nice" intervals—round numbers drawn from the set $\{1, 2, 5\} \times 10^k$ that divide the coordinate space into visually manageable segments. When the user leaves an interval at 0, the algorithm computes the span of the extent in decimal degrees, divides by a target of approximately 8 lines, and normalises the result to the nearest nice number. Each line is tagged with its orientation (meridian/parallel), its constant coordinate value, and a formatted human-readable label. Lines are aligned to the global coordinate origin (multiples of the interval starting from $\lfloor x_{\min} / \Delta x \rfloor \cdot \Delta x$), ensuring that adjacent map sheets will share coincident grid lines.
Mathematical Formulation
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Grid extent | Extent (xmin, xmax, ymin, ymax) | Canvas extent | CRS-dependent; in degrees for geographic CRS |
| X interval | Float | 0 (auto) | Meridian spacing in CRS units; 0 = auto |
| Y interval | Float | 0 (auto) | Parallel spacing in CRS units; 0 = auto |
Output Description
A line layer where each feature is a single meridian or parallel spanning the
full extent. Attributes include orientation (string:
“meridian” or “parallel”), coord (float,
the constant coordinate value), and label (string, formatted with
degree symbols and hemisphere suffix where appropriate). Lines are styled with a
thin, low-opacity stroke suitable for map overlay.
Interpretation Guide
References
- Robinson, A. H., Morrison, J. L., Muehrcke, P. C., Kimerling, A. J., & Guptill, S. C. Elements of Cartography (6th ed.). Wiley, 1995. ISBN 978-0471555797.
- Snyder, J. P. Map Projections—A Working Manual. U.S. Geological Survey Professional Paper 1395, 1987.
- Canters, F. & Decleir, H. The World in Perspective: A Directory of World Map Projections. Wiley, 1989. ISBN 978-0471921479.
- Iliffe, J. & Lott, R. Datums and Map Projections for Remote Sensing, GIS, and Surveying (2nd ed.). Whittles Publishing, 2008. ISBN 978-1904445470.
- Krygier, J. & Wood, D. Making Maps: A Visual Guide to Map Design for GIS (3rd ed.). Guilford Press, 2016. ISBN 978-1462509980.
- Slocum, T. A. et al. Thematic Cartography and Geovisualization (3rd ed.). Pearson, 2009. ISBN 978-0132298346.
7. Value-by-Alpha (VbA) Map
Theoretical Background
The Value-by-Alpha (VbA) map, introduced by Roth, Woodruff, and Johnson (2010), addresses a persistent cartographic tension: how to encode two variables on a choropleth when one variable represents the magnitude of a phenomenon and the other represents the reliability or confidence in that measurement. Traditional bivariate maps treat both variables symmetrically, but reliability is not a symmetric partner to magnitude—it is a meta-property that should qualify, not compete with, the primary signal.
The VbA solution encodes the primary variable through colour (hue and saturation) and the reliability variable through opacity (alpha channel). High-reliability features are rendered fully opaque, drawing the reader's attention with saturated colour; low-reliability features are partially transparent, visually receding into the background. This perceptual hierarchy mirrors the information hierarchy: the reader should first notice the pattern of the primary variable and then adjust their confidence based on the visibility of each unit.
CartoLab implements VbA by classifying the reliability variable into $n$ bins using Fisher-Jenks natural breaks (to respect the distributional structure of reliability), then mapping class bins linearly to an alpha range specified by the user. The primary variable is styled independently (graduated colour); the VbA alpha field is added as a data-defined opacity override in the renderer. MacEachren (1995) and Bertin (1967/1983) provided the theoretical foundation for visual variables and their perceptual ordering, of which the CartoLab implementation directly applies the hierarchy of colour over transparency.
Mathematical Formulation
vba_alpha_pct output field.
\tag{3}
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Input layer | Polygon vector | — | Must contain both primary and reliability fields |
| Primary variable (colour) | Numeric field | — | Encoded through hue/saturation |
| Reliability variable (opacity) | Numeric field | — | Higher = more opaque (typically) |
| Alpha min | Integer | 40 | Range 0–255; opacity for the least reliable bin |
| Alpha max | Integer | 255 | Range 0–255; opacity for the most reliable bin |
Output Description
The output polygon layer retains all original fields and adds
vba_alpha (integer, 0–255, the computed alpha channel value)
and vba_alpha_pct (float, 0–100, the same value as a
human-readable percentage). These fields can be used as data-defined overrides
for the opacity property in any QGIS renderer.
Interpretation Guide
References
- Roth, R. E., Woodruff, A. W., & Johnson, Z. F. Value-by-Alpha Maps: An Alternative Technique to the Cartogram. The Cartographic Journal, 47(2): 130–140, 2010. doi:10.1179/000870409X12488753453372
- MacEachren, A. M. How Maps Work: Representation, Visualization, and Design. Guilford Press, 1995 (revised 2004). ISBN 978-1572300408.
- Bertin, J. Semiology of Graphics: Diagrams, Networks, Maps. University of Wisconsin Press, 1983. (Original French edition 1967.) ISBN 978-0299090603.
- Sun, H. & Li, Z. Effectiveness of Cartogram for the Representation of Spatial Data. The Cartographic Journal, 47(1): 12–21, 2010.
- Garlandini, S. & Fabrikant, S. I. Evaluating the Effectiveness and Efficiency of Visual Variables for Geographic Information Visualization. In: Spatial Information Theory (COSIT), LNCS 5756: 195–211. Springer, 2009.
- Brewer, C. A. & Pickle, L. Evaluation of Methods for Classifying Epidemiological Data on Choropleth Maps in a Series. Annals of the Association of American Geographers, 92(4): 662–681, 2002.
- Robinson, A. C. Visual Highlighting Methods for Geovisualization. Cartography and Geographic Information Science, 38(4): 373–383, 2011.
8. Quick Style
Theoretical Background
Map styling is the bridge between data and visual communication, yet the default single-symbol renderer in GIS software forces the analyst to manually configure classification, colour ramps, and legend formatting before any meaningful pattern is visible. Quick Style automates this pipeline with cartographically informed defaults, applying Harrower and Brewer's (2003) ColorBrewer palettes for categorical data and the perceptually uniform Viridis family for sequential numeric data. The goal is to produce a publication-ready styled layer in a single operation.
The algorithm detects the field type (numeric or string) and auto-selects a graduated or categorised renderer accordingly, with a force-mode override for cases where coded integers should be treated as categories. For graduated renderers, the user selects from three break methods: quantile (equal count per class), equal interval (equal data range per class), or geometric interval (optimal for skewed distributions, as described in Algorithm 1). The quantile method is the default for choropleth mapping per Brewer's (1994) recommendation for ordinal color schemes, as it ensures each colour class contains approximately the same number of observations.
The output includes a thin white outline (0.15 mm) that visually separates adjacent polygons without drawing attention to boundaries—a technique borrowed from print cartography where a hairline gap between fill areas improves figure-ground discrimination. The style summary string provides a compact report of the applied configuration for reproducibility.
Mathematical Formulation
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Vector layer | Loaded vector layer | — | Must be loaded in the current QGIS project |
| Field | Any field | — | Numeric triggers graduated; text triggers categorised |
| Mode | Enum | Auto | Auto / Graduated / Categorised |
| Classes | Integer | 5 | Range 2–12 |
| Break method | Enum | Quantile | Quantile / Equal Interval / Geometric Interval |
| Palette | Enum | Viridis | ColorBrewer or Viridis family palette |
| Reverse | Boolean | False | Invert the colour ramp direction |
| Thin white outline | Boolean | True | Adds a 0.15 mm white stroke to polygon fills |
Output Description
The output is an in-place styled layer: no new layer is created; the existing layer's renderer is replaced with the computed graduated or categorised renderer. The algorithm returns a summary string (e.g., “Graduated: pop_density, 5 quantile classes, Viridis”). The legend is automatically populated with formatted class labels.
Interpretation Guide
References
- Harrower, M. & Brewer, C. A. ColorBrewer.org: An Online Tool for Selecting Colour Schemes for Maps. The Cartographic Journal, 40(1): 27–37, 2003. doi:10.1179/000870403235002042
- Brewer, C. A. Color Use Guidelines for Mapping and Visualization. In: MacEachren, A. M. & Taylor, D. R. F. (eds.) Visualization in Modern Cartography. Pergamon, 1994: 123–147.
- Brewer, C. A. Designing Better Maps: A Guide for GIS Users (2nd ed.). ESRI Press, 2015. ISBN 978-1589484405.
- Smith, R. M. Comparing Traditional Methods for Selecting Class Intervals on Choropleth Maps. The Professional Geographer, 38(1): 62–67, 1986.
- Monmonier, M. How to Lie with Maps (3rd ed.). University of Chicago Press, 2018. ISBN 978-0226435923.
- Kimerling, A. J., Buckley, A. R., Muehrcke, P. C., & Muehrcke, J. O. Map Use: Reading, Analysis, Interpretation (8th ed.). ESRI Press, 2016. ISBN 978-1589484429.
9. Proportional Symbols (Flannery)
Theoretical Background
Proportional symbol maps encode a quantitative variable through the size of a point symbol placed at each feature's centroid. The technique is particularly suited to count or magnitude data where the absolute value, rather than the density, is the quantity of interest. The central perceptual challenge is that map readers systematically underestimate the area of larger circles: Flannery (1971) demonstrated experimentally that the perceived size $S_p$ follows Stevens' (1957) power law, $S_p \propto S^{k}$ with $k \approx 0.8747$, rather than the geometric $S_p \propto S^{1.0}$ or $S_p \propto S^{0.5}$ (radius scaling). The common Flannery compensation exponent of $k = 0.5716$ adjusts the area scaling so that the reader's perceived ratio between symbols approximates the true data ratio.
The CartoLab implementation scales symbol size (in map millimetres) from the user-specified minimum and maximum, applying either Flannery-compensated scaling ($k = 0.5716$) or true area scaling ($k = 0.5$, i.e., radius $\propto \sqrt{v}$). The algorithm also computes suggested legend values at geometrically spaced intervals rounded to nice numbers (1, 2, 5 $\times 10^m$), providing the map author with a ready-made set of reference symbols. Cleveland and McGill (1984) ranked position along a common scale as the most accurate visual variable, but among area-based encodings, circle size is the most accurate and the most commonly used.
Mathematical Formulation
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Input layer | Any vector | — | A point symbol is placed at each feature's centroid |
| Magnitude field | Numeric field | — | Drives the symbol size; must be positive |
| Max symbol size (mm) | Float | 10.0 | Symbol size for the maximum value |
| Min symbol size (mm) | Float | 2.0 | Symbol size for the minimum value |
| Flannery compensation | Boolean | True | Apply $k = 0.5716$; false uses $k = 0.5$ |
Output Description
The output is a point layer with one point per input feature (at its centroid).
New fields: psym_value (the original magnitude value, echoed for
reference), psym_size (float, symbol diameter in millimetres). The
layer is auto-styled with a data-defined marker size using psym_size.
The algorithm log prints suggested legend values for manual legend construction.
Interpretation Guide
References
- Flannery, J. J. The Relative Effectiveness of Some Common Graduated Point Symbols in the Presentation of Quantitative Data. The Canadian Cartographer, 8(2): 96–109, 1971.
- Stevens, S. S. On the Psychophysical Law. Psychological Review, 64(3): 153–181, 1957. doi:10.1037/h0046162
- Cleveland, W. S. & McGill, R. Graphical Perception: Theory, Experimentation, and Application to the Development of Graphical Methods. Journal of the American Statistical Association, 79(387): 531–554, 1984. doi:10.1080/01621459.1984.10478080
- Chang, K. Visualizing Geometric Uncertainty of Proportional Symbol Maps. Cartography and Geographic Information Science, 36(4): 349–365, 2009.
- Groop, R. E. & Cole, D. Overlapping Graduated Circles: Magnitude Estimation and Method of Portrayal. The Canadian Cartographer, 15(2): 114–122, 1978.
- Slocum, T. A. et al. Thematic Cartography and Geovisualization (3rd ed.). Pearson, 2009. ISBN 978-0132298346.
- Tanimura, S., Kuroiwa, C., & Mizota, T. Proportional Symbol Mapping in R. Journal of Statistical Software, 15(5): 1–7, 2006.
10. Ridge Map (Joy Division Style)
Theoretical Background
The ridge map, sometimes called a Joy Division map after Peter Saville's iconic album cover design for Unknown Pleasures (which itself adapted a plot of radio pulsar CP 1919), transforms a raster surface into a set of vertically deformed scanlines. Each scanline is a horizontal transect across the raster; pixel values displace the line vertically, creating an overlapping sequence of wave-like profiles. The resulting graphic encodes elevation, density, or any continuous raster variable as a rhythmic spatial texture that is immediately legible as topography.
The technique owes its intellectual lineage to Tufte's (1983) principle of data-ink maximisation and Imhof's (1982) cartographic relief presentation, both of which argue that surface representation should reveal the underlying data structure with minimal decorative intervention. The ridge map's aesthetic of overlapping transparent lines produces a figure-ground effect where crests (high pixel values) visually advance and troughs (low values) recede, mimicking shaded relief despite using only vector linework.
CartoLab implements ridge mapping by sampling the input raster along equally spaced horizontal scanlines, deforming each $y$-coordinate by the pixel value multiplied by a user-specified vertical exaggeration. An optional Laplacian smoothing pass (averaging each vertex with its two neighbours) reduces high-frequency noise from the raster. The scanlines are clipped to an optional user-supplied polygon extent. The output is a vector line layer suitable for rendering with dark-background and transparency for the overlapping ridge effect.
Mathematical Formulation
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Input raster (single-band) | Raster layer | — | Single-band; multi-band uses the first band |
| Number of scanlines | Integer | 100 | Range 5–500; more = denser ridge pattern |
| Vertical exaggeration | Float | 1.0 | Multiplier on pixel values in map units |
| Line spacing | Float | 0 | 0 = auto (equal spacing); manual override in map units |
| Smoothing passes | Integer | 1 | Range 0–20; 0 = raw raster values |
| Clip extent | Polygon (optional) | — | Restricts output to a specific region |
Output Description
A LineString vector layer with line_id (integer, scanline index
from top to bottom). Each line contains the deformed vertex sequence. The
recommended styling uses a dark background (#132025 or similar), a light stroke
(white or pale colour), low opacity (10–40%), and no fill. The line_id
field enables per-line styling, e.g., data-defined colour ramps.
Interpretation Guide
References
- Tufte, E. R. The Visual Display of Quantitative Information. Graphics Press, 1983 (2nd ed. 2001). ISBN 978-1930824133.
- Imhof, E. Cartographic Relief Presentation. De Gruyter, 1982 (English ed. 2007, edited by H. J. Steward). ISBN 978-1589484580.
- Wood, D. The Power of Maps. Guilford Press, 1992. ISBN 978-0898624922.
- Lobeck, A. K. Block Diagrams and Other Graphic Methods Used in Geology and Geography. Emerson-Trussell, 1924 (2nd ed. 1958).
- Tanaka, K. The Relief Contour Method of Representing Topography on Maps. Geographical Review, 40(3): 444–456, 1950.
- Kennelly, P. J. & Kimerling, A. J. Desktop Hachure Maps from Digital Elevation Models. Cartographic Perspectives, 37: 78–81, 2000.
- Brewer, C. A. Designing Better Maps: A Guide for GIS Users (2nd ed.). ESRI Press, 2015. ISBN 978-1589484405.
11. Building 2.5D Style
Theoretical Background
The 2.5D representation bridges the gap between two-dimensional planimetric maps and full three-dimensional scenes. By extruding polygon footprints vertically and rendering them with an isometric or pseudo-3D projection, the technique conveys building height, massing, and urban form while retaining the precision and measurability of a 2D map. QGIS' native 2.5D renderer, introduced in version 3.x, applies an isometric affine transformation to extruded geometry and renders walls and roofs with user-configurable materials and lighting.
The CartoLab implementation offers two modes: the native QGIS 2.5D renderer (configuring angle, height scale, shadow, wall colour, and roof colour via a live preset system) and the per-floor colour-band mode. The per-floor mode divides the building height into floor-height increments and applies a repeating colour palette to each floor band, producing a legend-friendly single-symbol renderer where each floor is a separate symbol layer. This approach, inspired by Jenny et al.'s (2010) design principles for Swiss-style rock drawing, uses systematic colour coding to reveal floor patterns across an urban landscape.
The visual presets (Warm Civic, Cool Slate, Limestone & Teal, Night Copper, Urban Core Gold, Suburban Pastoral, Cyberpunk Night, Nordic Minimalist, Emerald Metropolis, and Terracotta Mediterranean) apply pre-tuned combinations of roof colour, wall colour, shadow strength, and material style. The height can be supplied in metres (direct field value) or in floor count (field value $\times$ floor height in metres). An optional height clamp caps extreme outliers, and stepped extrusion toggles between smooth (continuous extrusion) and stepped (floor-level increments) wall profiles.
Mathematical Formulation
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Polygon layer | Loaded polygon vector | — | Building footprint layer |
| Height field | Numeric field | — | Height in metres or floor count |
| Height mode | Enum | Metres | Metres (direct value) or Floors (count * floor height) |
| Floor height | Float | 3.0 | Metres per floor; used in floors mode and floor-band renderer |
| Renderer style | Enum | 2.5D | Native 2.5D renderer or Per-floor colour bands |
| Floor palette | Enum | Civic Spectrum | Civic Spectrum, Planning Bands, Soft Atlas, Turbo Height, Viridis Height |
| Max floors | Integer | 30 | Maximum number of symbol layers generated |
| Visual preset | Enum | Warm Civic | Warm Civic, Cool Slate, Limestone & Teal, Night Copper, Urban Gold, Suburban Pastoral, Cyberpunk, Nordic, Emerald Metropolis, Terracotta Mediterranean |
| Angle | Float | 110.0 | Viewing azimuth in degrees |
| Height scale | Float | 1.0 | Vertical exaggeration multiplier |
| Max height clamp | Float | 0 (off) | Cap extreme heights; 0 = no clamp |
| Stepped | Boolean | False | Stepped extrusion at floor intervals |
| Shadow | Boolean | True | Cast shadow from a 315° light source |
| Wall shading | Boolean | True | Darken walls facing away from the light |
Output Description
The output is an in-place styled layer: the existing layer's renderer is replaced. A summary string describes the applied configuration (e.g., “2.5D: Warm Civic preset, 110° angle, height_metres, shadow on”). For the floor-band mode, a separate symbol layer is created for each floor level up to Max Floors, each with a data-defined height filter.
Interpretation Guide
References
- QGIS Development Team. QGIS 2.5D Renderer Documentation. QGIS User Manual, 2024. qgis.org/docs
- Jenny, B., Gilgen, J., Geisthövel, R., Marston, B. E., & Hurni, L. Design Principles for Swiss-Style Rock Drawing. The Cartographic Journal, 47(4): 323–332, 2010.
- Kraak, M. J. & Ormeling, F. Cartography: Visualization of Geospatial Data (3rd ed.). Guilford Press, 2011. ISBN 978-1609181949.
- Haeberling, C., Bär, H., & Hurni, L. Proposed Cartographic Design Principles for 3D Maps. Cartography and Geographic Information Science, 35(4): 309–324, 2008.
- Döllner, J. & Buchholz, H. Continuous Level-of-Detail Modeling of Buildings in 3D City Models. Proceedings of ACM GIS, 2005.
- Jobst, M. & Döllner, J. Better Perception of 3D-Spatial Relations by View-Dependent Mixed-Mode Rendering of 2D and 3D Maps. International Journal of Geographical Information Science, 22(10): 1085–1103, 2008.
- Kwan, M. P. & Lee, J. Geovisualization of Human Activity Patterns Using 3D GIS: A Time-Geographic Approach. In: Goodchild, M. F. & Janelle, D. G. (eds.) Spatially Integrated Social Science. Oxford University Press, 2004.
12. Visual-Center Label Points
Theoretical Background
The visual centre of a polygon—the point from which a label appears most naturally to belong to the enclosing area—is not the centroid. Centroids can fall outside their polygon for concave shapes (e.g., C-shaped administrative units, crescent-shaped lakes, doughnut polygons with interior holes). The cartographic requirement is for a point that is guaranteed to lie inside the polygon and is as far as possible from any edge, maximising the available space for a label.
The polylabel algorithm, developed by Mapbox (2016), solves this problem efficiently using a quad-tree search with a priority queue. The algorithm maintains a max-heap ordered by each cell's potential: the distance from the cell centre to the nearest polygon edge plus the cell's half-diagonal (the maximum possible improvement from subdividing that cell). At each step, the cell with the highest potential is subdivided into four children, and the candidate point is updated whenever a cell centre has a larger signed distance than the current best. The search terminates when the best cell's potential falls within the specified precision of the best known distance.
The signed distance uses ray-casting to determine whether a point is inside the polygon; points outside receive a negative distance. This approach generalises to polygons with holes, multi-part geometries, and complex concavities. Garcia-Castellanos and Lombardo (2007) provided the theoretical analogue for the "pole of inaccessibility" on Earth's land surface; the polylabel algorithm adapts the quad-tree search for the vector case.
Mathematical Formulation
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Input polygon layer | Polygon vector | — | Polygons for which to compute label points |
| Precision | Float | 0 (auto) | Search precision in map units; 0 auto-scales from bbox/100 |
Output Description
A point layer with one point per input polygon. Each point carries:
lbl_dist(float, the inscribed circle radius / distance to nearest boundary in map units).lbl_angle(float, principal spatial inertia orientation angle in degrees, $[-90^\circ, +90^\circ]$).
Interpretation Guide
lbl_dist is the key quality metric: a value less
than approximately 2 mm in map units at the target scale suggests that the
polygon is too narrow for a readable label and should be labelled with a leader
line or left unlabelled. The lbl_angle field provides the exact angle to align map labels with elongated parcels, building wings, or river segments.
References
- Mapbox. Polylabel: A Fast Algorithm for Finding the Pole of Inaccessibility of a Polygon. GitHub/mapbox/polylabel, 2016.
- Garcia-Castellanos, D. & Lombardo, U. Poles of Inaccessibility: A Calculation Algorithm for the Remotest Places on Earth. Scottish Geographical Journal, 123(3): 227–233, 2007. doi:10.1080/14702540801897856
- de Berg, M., Cheong, O., van Kreveld, M., & Overmars, M. Computational Geometry: Algorithms and Applications (3rd ed.). Springer, 2008. ISBN 978-3540779735.
- Edmondson, S., Christensen, J., Marks, J., & Shieber, S. A General Cartographic Labelling Algorithm. Cartographica, 33(4): 13–23, 1996.
13. Choropleth Normalization & Rates
Theoretical Background
Raw counts are nearly always the wrong variable for a choropleth map. Plotting total population, total crime incidents, or total disease cases on a map of unequal-area enumeration units produces a map of the size of the units, not the intensity of the phenomenon. Normalisation transforms a raw magnitude into a rate, density, index, or relative score that is comparable across spatial units. Monmonier (1991) devoted an entire chapter to the dangers of mapping un-normalised counts, and the American Cartographic Association's (Dent et al., 2009) guidelines consider normalisation a prerequisite for any choropleth intended for comparison.
CartoLab implements six normalisation methods spanning the principal use cases: (1) Rate divides a numerator by a denominator and scales the result, producing a density or proportion; (2) Z-score standardises to zero mean and unit variance, suitable for statistical comparison; (3) Robust z uses median and MAD (median absolute deviation) instead of mean and standard deviation, resisting the influence of outliers; (4) Min-max scales to the range $[0, 1]$, useful for input to multi-criteria analysis; (5) Percentile rank maps each value to its empirical cumulative probability $\times 100$, providing a purely ordinal scale; (6) $\log_{10}$ compresses the dynamic range of power-law or log-normal data, with an automatic shift to handle zero and negative values.
The choice of normalisation method is as consequential as the choice of classification. Krygier and Wood (2016) advise matching the normalisation to the analytical question: rates for comparisons of intensity, z-scores for identifying outliers, percentile ranks for ordinal rankings, and log transforms for visualising data spanning multiple orders of magnitude. The CartoLab implementation auto-graduates the output with the Viridis colour ramp and records the method in the output field for transparency.
Mathematical Formulation
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Input layer | Vector (any geometry) | — | Layer containing the field to normalise |
| Value field | Numeric field | — | Raw count or magnitude to transform |
| Method | Enum | Rate | 0 = Rate, 1 = Z-score, 2 = Robust z, 3 = Min-max, 4 = Percentile rank, 5 = Log10, 6 = Location Quotient, 7 = Winsorized Min-Max, 8 = Decile Rank |
| Denominator field | Numeric field | — | Required for Rate and Location Quotient methods; ignored for others |
| Rate scale | Float | 100 | Multiplier applied to the ratio; e.g., 100 = % |
Output Description
The output layer is a copy of the input with two new fields: norm_value
(float, the transformed value) and norm_method (string, the method
name applied, e.g., “location_quotient”). The layer is auto-graduated with the
Viridis colour ramp. For the Rate and Location Quotient methods, denominator metrics are recorded
in the processing log for scientific provenance.
Interpretation Guide
References
- Monmonier, M. How to Lie with Maps (3rd ed.). University of Chicago Press, 2018. ISBN 978-0226435923.
- Dent, B. D., Torguson, J. S., & Hodler, T. W. Cartography: Thematic Map Design (6th ed.). McGraw-Hill, 2009. ISBN 978-0072943825.
- Isard, W. Methods of Regional Analysis: An Introduction to Regional Science. MIT Press, 1960.
- Tukey, J. W. Exploratory Data Analysis. Addison-Wesley, 1977.
- Rousseeuw, P. J. & Croux, C. Alternatives to the Median Absolute Deviation. Journal of the American Statistical Association, 88(424): 1273–1283, 1993.
14. Interactive Bivariate Studio & Color Matrix Widget
Theoretical Background
The Interactive Bivariate Studio provides real-time exploration of 2D spatial relationships directly inside QGIS. By combining two continuous variables into an $N \times N$ matrix ($3\times3$ or $4\times4$), it reveals spatial correlations, spatial mismatches, and trade-offs (such as Social Vulnerability vs. Flood Hazard, or Public Transit Accessibility vs. Land Value).
Color Matrix Interpolation
Curated Palette Themes
| Preset | $C_{LL}$ | $C_{LH}$ | $C_{HL}$ | $C_{HH}$ | Cartographic Use Case |
|---|---|---|---|---|---|
| Classic Brown-Teal | #e8e8e8 | #5ab4ac | #d8b365 | #8c510a | General socio-economic & environmental mapping |
| Pink-Blue (Robin) | #e8e8e8 | #64acbe | #c85a5a | #574249 | Urban vulnerability & demographic shifts |
| Purple-Green | #e8e8e8 | #7b3294 | #008837 | #2c103b | Land use & ecological suitability |
| Warm Orange-Cyan | #e8e8e8 | #2b83ba | #fdae61 | #d7191c | Heat island vs. green canopy coverage |
| Sunset Purple-Gold | #e8e8e8 | #7b2cbf | #f4a261 | #e76f51 | Housing affordability vs. employment access |
15. Print Layout Studio Suite
Theoretical Background
The Print Layout Studio automates high-end cartographic layout production, eliminating tedious manual drafting while enforcing strict ISO page geometry, Swiss typography hierarchies, optical margins, and harmonious spatial balance.
Key Capabilities
- Map Sheet Generator: Automated single and multi-sheet map production with standard ISO paper sizes ($A0-A4$) in portrait or landscape orientations, calculating exact map scales ($1:S$) with dynamic bounding extents.
- Contextual Overview Locator Inset: Automatically positions an overview inset map at $4\times$ smaller scale in a user-chosen corner, complete with dynamic red extent indicators.
- Isometric 3D Layer Stacking: Generates multi-layer axonometric $30^\circ$ perspective layouts with adjustable layer offsets ($\Delta z$) and vertical dashed alignment lines.
- Paper Canvas Themes: Velvet Dark (
#0B0F19), Warm Editorial (#FDFBF7), Technical Blueprint (#0C2340), Antique Parchment (#F4ECD8), Japanese Washi (#FAF8F5), and Clean White (#FFFFFF). - Publication Typography Hierarchy: Swiss Modern (Inter/Helvetica), Academic Serif (Merriweather/Times), Technical Blueprint (Roboto Mono), and Editorial Warm (Lora/Georgia).
- Modern Chevron North Needle (
modern_arrow): Architectural chevron needle with vertical meridian baseline.
16. Color Accessibility & CVD Simulation Engine
Theoretical Background
Ensures maps comply with WCAG 2.1 AAA accessibility standards and remain legible for individuals with Color Vision Deficiencies (CVD / Daltonism: Deuteranopia, Protanopia, Tritanopia).
17. Solar Position & Sun Angle Calculator
Theoretical Background
Computes real astronomical solar altitude and azimuth based on geographic latitude ($\phi$), day of year ($n$), and solar hour ($H$) to generate accurate 2.5D building shadows and daylight analysis.
18. Perceptual Scientific & Topographic Color Ramps Library
Curated Scientific Ramps
| Palette | Type | Colorblind Safe | Primary Use Case |
|---|---|---|---|
| Turbo | Sequential Multi-Hue | Partial | High-contrast continuous density & urban heat islands |
| Mako | Sequential Monotonic | Yes | Water depth, marine morphology & wetlands |
| Rocket | Sequential Hot | Yes | Fire risk, building density & traffic congestion |
| Earth | Topographic Diverging | Yes | Elevation gradients, land-use zoning & soil moisture |
| Bathymetry | Marine Sequential | Yes | Coastal bathymetry & flood inundation levels |
| IceFire | Cyclic / Diverging | Yes | Temperature anomalies, thermal stress & solar radiation |