This post shows how to build a colored pencil map with R.
The cartography package (in its development version) has gained a getPencilLayer() function that transforms a POLYGON or MULTIPOLYGON layer into a MULTILINESTRING layer mimicking a pencil drawing pattern.
This post exposes some cartographic explorations of the OpenStreetMap (OSM) database with R.
These explorations begin with the downloading and the cleaning of OSM data. Then I propose a set of map visualizations of the spatial distributions of bars and restaurants in Paris. Of course, these examples could be adapted to other spatial contexts and thematics (e.g. pharmacies in Roma, bike parkings in Dublin…).
The osmdata package from rOpenSci is used to download OSM data.
The cleaning is a rather manual task done thanks to the sf package.
Most of the mapping is done with sf and cartography.
Interactive maps are handled with the leaflet package.
Smoothed maps are computed with spatstat.
mtmx has done the same kind of analyses using a different data source (Sirene database): Bistrographie (in French).
cartography allows various cartographic representations such as proportional symbols, chroropleth, typology, flows or discontinuities maps. It also offers several features enhancing the graphic presentation of maps like cartographic palettes, layout elements (scale, north arrow, title…), labels, legends or access to some cartographic APIs.
Up to version 1.4.2 cartography was mainly based on sp and rgeos for its spatial data management and geoprocessing operations. These dependencies have been 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.
See the NEWS file for the full list of changes and see sf README in case of installation problems with sf. Continuer la lecture de New version of the cartography package→