Trying to reproduce a map of the greater Paris area from APUR with ggplot2, a moment for coloring

[This article was first published on Guillaume Pressiat, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

In 2016, APUR the Paris urbanism agency published a map that described new Greater Paris area, see here.

At this time I was interested to reproduce this map in R with official datas/shapefiles and ggplot2.

A moment for coloring.

I put this code story here to let it somewhere else than my head (I have lost part of the code since 2016) and to share.

Here is the map from APUR:


capture from apur

Trying to mimick with ggplot2

First thing was to define T1 to T12 areas (groups of cities) and use french national geographic institute (IGN) shapefiles to plot a beginning ggplot2 map:

first ggplot2

After some efforts, I was able to show this in R:

second ggplot2

La Seine and co.

Last thing that was not shown are rivers and canals. I had to find a shapefile for this.

Fortunately, I have found a shapefile from APUR website directly, named PLAN_EAU.

With this data, I have been able to show La Seine, La Marne, le Port de Gennevilliers and Paris canals.

Here I have plotted Grand Paris with “carbon like” colors to highlight this new area and because I find it’s pretty cool like that!

R is really a nice environment.

carbon paris ggplot2

See here in pdf

Greater Paris map with R

I was able to output something like this.

g paris end ggplot2

Code for these maps is not clean but is available here.

In this code, there are several steps:

  • import shapefiles (rgdal)
  • define Greater Paris area(s)
  • union of regions with rgal/rgeos
  • fortify shapefiles to plot polygons with ggplot2
  • draw rivers and canals as polygons and paths (geoms)

Last map to mimick APUR map can be seen here in pdf.

To leave a comment for the author, please follow the link and comment on their blog: Guillaume Pressiat.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)