I use R to do my geo stuff with two limitations. First, I'm pretty new to all the geo stuff, and second I got lost while searching for a shapefile. I'm looking for a shapefile that contains all the gadm level 3 (possibly level 2 would suffice too) for all African countries. I could theoretically, download all the shapefiles from Global Administrative Areas and combine them into one masterfile (that would be another question). However, I was wondering if such a shapefile already exists… And if so, where?
[GIS] One shapefile for African continent containing counties/regions
africadatagadm
Best Answer
So the answer is probably going to be no, there is no shapefile that is gadm data level 3 or 2 available for all of Africa because some countries only have data up to level 1 (Libya, West Sahara, etc. ).
That being said you can download the data and combine it into a shapefile – I was able to get the whole continent at level 1 downloading the rds files using an adjusted version of the script below which downloads all of Africa available at level 2 and grabs the rest at level one and makes shapefile of both subsets. You can merge them together using the union command In qgis if you use that or look into the union() command in the raster R package
I wrote a script that does the following:
There is definitely a more elegant way to do this but this seems to work.