cartography

Thematic Cartography

Create and integrate maps in your R workflow. This package helps
to design cartographic representations such as proportional symbols,
choropleth, typology, flows or discontinuities maps. It also offers several
features that improve the graphic presentation of maps, for instance, map
palettes, layout elements (scale, north arrow, title...), labels or legends.
See Giraud and Lambert (2017) .

Create and integrate maps in your R workflow!

This package helps to design cartographic representations such as proportional symbols, choropleth, typology, flows or discontinuities maps. It also offers several features that improve the graphic presentation of maps, for instance, map palettes, layout elements (scale, north arrow, title...), labels or legends.

Cheat Sheet

The cheat sheet displays a quick overview of cartography's main features.

Vignette

The vignette
contains commented scripts on how to build various types of maps with cartography:

legend*() and relevant function: new "bottomleftextra" position for the legend. It displays the legend in the bottomleft corner with and extra padding that allows the display of sources and author with layoutLayer() without overlapping.

Minor changes

*typoLayer(): fix incorrect display of typo legends if legend.order is not provided.

data: addition of a GeoPackage on Martinique municipalities (descritpion on vignette), a csv on work mobilities

add a test suit

add a pkgdown website

cartography 2.1.2

Minor changes

fix in getGridLayer() for type ="hexagon" (sp import)

addition of a cheat cheat reference in vignette (new vignette with a single link)

Allow unprojected sf as input for getPencilLayer and prevent sampling error with a warning.

vignette correction (deprecated argument)

cartography 2.1.1

Minor changes

rgeos is back to Imports (was actually needed for some sp <> sf transformation)

Add getPencilLayer function (color pencil layers)

small fixes to follow sf API changes (warnings with st_centroids)

cartography 2.1.0

Major changes

sp and sf goes from Depends to Import, this implies the need to use library(sf) or library(sp) before using most of cartography functions.

rgeos is not used anymore

packages sp, sf, graphics, stats, classInt and graphics are no more fully imported in the namespace

Minor changes

a lot of typos and mis-spelled words have been corrected

propSymbols*Layer legends use the lwd argument

LegendProp* have gained a border and an lwd argument

cartography 2.0.2

Minor Changes

bug fix in labelLayer() when x = SpatialPointsDataFrame.

bug fix in propSymbols*Layer() when using a POINT layer with add=FALSE.

bug fix in *Link*Layer() (df).

add R, sf and sp version requirement + sf SystemRequirements

allow dataframe AND tibbles as input for df argument in relevant functions

add postitle to set the position of the title in laoutLayer()

add tabtitle to set the size of the title banner in layoutLayer()

cartography 2.0.1

Minor Changes

bug fix for proportionnal symbols with negative values.

cartography 2.0.0

Breaking changes

Up to version 1.4.2 cartography was mainly based on sp and and rgeos for its
spatial data management and geoprocessing operations. These dependencies
are as much as possible replaced by sf functions since version 2.0.0.
Most functions are kept unchanged except for the addition of an x argument
used to take sf objects as inputs.

getBorders, getOuterBorders: an x argument is added in first position, x is added to take sf objects as inputs, if x is used then spdf is not used. spdfid is replaced by id. An sf object (MULTILINESTRING) of borders is returned.

getGridLayer: getGridLayer replaces getGridLayer + getGridData, x argument replaces spdf and can take an sf object or an sp object. var is added to enter the name(s) of numeric field(s) to compute into the grid. cellsize refers to the targeted area of the cells. The function returns an sf object

getLinkLayer: spdf, spdf2, df, spdfid, spdf2id, dfids and dfide arguments are replaced by x, xid, df and dfid. x can be either a Spatial*DataFrame or an sf object. The function returns an sf LINESTRING instead of a SpatialLinesDataFrame.

legend* functions have been enhanced to be more customizable. It is now possible to lay legend on specified x & y.

propSymbolsLayer: breakval and col2 arguments are defunct, use propSymbolsTypoLayer if needed.

Major changes

choroLayer, typoLayer, propSymbolsLayer, propSymbolsChoroLayer, propSymbolsTypoLayer, dotDensityLayer, getTiles, getFigDim, labelLayer, smoothLayer: an x argument is added in first position of all these functions. x is added to take sf objects as inputs, if x is used then spdf, df, spdfid, id are not used.

labelLayer: possibility to add a colored halo around the labels, option to have non-overlapping labels.

layoutLayer: the extent argument can take an sf object.

Each function has an example based on sf object.

possibility to use text labels in legendChoro

cartography 1.4.2

Minor changes

Addition of 2 discretization methods (thanks to @MBunel): 'em' and 'arith'. The "arith" method is based on a arithmetic progression along the variable values. The "em" method is based on subset defined by the mean of a numeric vector.

Update the list of the available tiles servers (getTiles). This list is reduced and could be extended again depanding on the rosm package evolution.

Minor changes

Introduce the legend.*.values.order parameter in typoLayer, propSymbolsTypoLayer and gradLinkTypoLayer. This parameter allows to order modalities in the legend and eases the color assignement.

Change min value in prop*Layer legends.

Suppress zero values in propSymb*Layer.

getGridLayer is faster.

getLinkLayer is faster.

getBorders is faster.

cartography 1.2

Major changes

The OpenStreetMap package used to display OpenStreetMap tiles has been replaced by the rosm package. rosm installation is lighter and easier (no Java dependency).

The k parameter is deprecated in propSymbolsLayer, propSymbolsTypoLayer and propSymbolsChoroLayer. The inches parameter is to be used instead. This modification allows to compare proportionnal symbols maps.