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…).
This reproducible analysis is hosted on GitHub (code + data + walk-through).
osmdata package from rOpenSci is used to download OSM data.
The cleaning is a rather manual task done thanks to the
Most of the mapping is done with
Interactive maps are handled with the
Smoothed maps are computed with
mtmx has done the same kind of analyses using a different data source (Sirene database): Bistrographie (in French).
This blog post: What should I have for lunch? by Emma Vestesson.
A new version of the
cartography package (v2.0.1) has arrived on CRAN.
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
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.
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
osrm package is an interface between R and the OSRM API. OSRM is a routing service based on OpenStreetMap data.
This package allows computing shortest paths and travel time matrices between points. Continuer la lecture de Shortest Paths and Travel Time from OpenStreetMap with R
The cartography package allows various cartographic representations such as proportional symbols, chroropleth, typology, flows or discontinuities. In addition it also proposes some useful features like cartographic palettes, layout (scale, north arrow, title…), labels, legends or access to cartographic API to ease the graphic presentation of maps. Continuer la lecture de Create and integrate maps in your R workflow with the cartography package