Timothée Giraud, Nicolas Lambert


1 Introduction

The aim of cartography is to obtain thematic maps with the visual quality of those build with a classical mapping or GIS software.

Users of the package could belong to one of two categories: cartographers willing to use R or R users willing to create maps. Therefore, its functions have to be intuitive to cartographers and ensure compatibility with common R workflows.

cartography uses sf or sp objects to produce base graphics. As most of the internals of the package relies on sf functionalities, the preferred format for spatial objects is sf.

2 Features

cartography’s functions can be classified in the following categories :

3 Examples of thematic maps

3.1 OpenStreetMap Basemap and Proportional Symbols

getTiles() and tilesLayer() download and display OpenStreetMap tiles. Be careful to cite the source of the tiles appropriately.

propSymbolsLayer() displays symbols with areas proportional to a quantitative variable (stocks). Several symbols are available (circles, squares, bars). The inches argument is used to customize the symbols sizes.

3.2 Choropleth Map

In choropleth maps, areas are shaded according to the variation of a quantitative variable. They are used to represent ratios or indices.

choroLayer() displays choropleth maps . Arguments nclass, method and breaks allow to customize the variable classification. getBreaks() allow to classify outside of the function itself. Colors palettes are defined with col and a set of colors can be created with carto.pal() (see also display.carto.all()).

3.3 Colored Pencil and Typologies Map

getPencilLayer() transforms POLYGONS or MULTIPOLYGONS in MULTILINESTRINGS. This function creates a layer that mimicks a pencil hand-drawing.

typoLayer() displays a typology map of a qualitative variable. legend.values.order is used to set the modalities order in the legend.

3.4 Proportional Symbols and Choropleth Map

propSymbolsChoroLayer() creates a map of symbols that are proportional to values of a first variable and colored to reflect the classification of a second variable. A combination of propSymbolsLayer() and choroLayer() arguments is used.

3.5 Proportional Symbols and Typology Map

propSymbolsTypoLayer() creates a map of symbols that are proportional to values of a first variable and colored to reflect the modalities of a second qualitatice variable. A combination of propSymbolsLayer() and typoLayer() arguments is used.

3.6 Label Map

labelLayer() is dedicated to the display of labels on a map. The overlap = FALSE argument displays non overlapping labels.