Create maps with maptools R package

Posted in Dataset, R by Julyan Arbel on 13 December 2011

Baptiste Coulmont explains on his blog how to use the R package maptools. It is based on shapefile files, for example the ones offered by the French geography agency IGN (at départements and communes level). Some additional material like roads and railways are provided by the OpenStreetMap project, here. For the above map, you need to dowload and dezip the files and The red dots correspond to points of interest longitude / latitude, here churches stored in a vector eglises (use e.g. this to geolocalise places of interest). Then run this code from Baptiste’s tutorial


Created by Pretty R at


4 Responses

Subscribe to comments with RSS.

  1. dimitris said, on 5 January 2012 at 10:36

    hi and happy new year,
    i tried to reproduce your example because i have some troubles combining openstreet maps and maptools. For some reason i cannot load the shp files from IGN but my french are really poor to understand if i am making a mistake 🙂

    i was wondering how do you combine these two? if i export an area from openstreet maps, lets say this ( and plot it with maptools with shapefiles for the world like this
    i get the export area from openstreet maps and put it xlim and ylim
    i get this result

    which is different. From what i see from your example, you use longlat, i use the same projection but i get different plot areas..which projection (i guess it is a projection issue cause i am newbie in plotting maps) should i use to to plot correctly the exported area from openstreet maps with maptools in R?


  2. Julyan Arbel said, on 5 January 2012 at 15:32

    Hi Dimitris, you make me realize there is the same issue for the map above : ylim bounds are correct, but xlim ones are drawn wider than specified. Only a few minutes in my case, but several degrees for your map. Probably an issue of projection, see here for the use of rgdal package (transformation operations): and here for a nice description of projection systems 🙂

    • dimitris said, on 7 January 2012 at 11:02

      so i am not the only one with this problem 🙂

      the link from the mailing list gives a reasonable explanation.

  3. Map | m's R Blog said, on 12 June 2013 at 20:39

    […] maptools (homepage, tutorial) […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: