Dear Statalisters
I'm trying to draw maps of England and Wales on the regional level, i.e. the nine macro-regions of England, plus Wales. I have two shapefiles: one for the regions of England, and one for the countries of Great Britain (England, Scotland and Wales), where I want to extract the boundaries of Wales and add to the English regions (full disclosure: there was a problem with the country shapefile, because it included a variable called "long" that shp2dta couldn't deal with, so I first modified the shapefile in R to remove this variable). There is an earlier thread that discusses a similar problem, but unfortunately these steps are not working for me.
I'm following the steps outlined by Roberto Liebscher in the tread mentioned above, simply appending the Wales boundaries to the English boundaries. However, whenever I try to draw a map (using Maurizio Pisati's spmap), Stata "freezes" (no error message, just a popup from Windows saying that the programme stopped responding) . Drawing the two maps individually is not a problem. It is also possible to add Wales as a polygon to the base map of the English regions, but ultimately I would like to draw choropleth maps, so that is not a satisfying option.
Here's the code I'm using (in Stata 15.0):
Many thanks for your time! Any thoughts appreciated!
I'm trying to draw maps of England and Wales on the regional level, i.e. the nine macro-regions of England, plus Wales. I have two shapefiles: one for the regions of England, and one for the countries of Great Britain (England, Scotland and Wales), where I want to extract the boundaries of Wales and add to the English regions (full disclosure: there was a problem with the country shapefile, because it included a variable called "long" that shp2dta couldn't deal with, so I first modified the shapefile in R to remove this variable). There is an earlier thread that discusses a similar problem, but unfortunately these steps are not working for me.
I'm following the steps outlined by Roberto Liebscher in the tread mentioned above, simply appending the Wales boundaries to the English boundaries. However, whenever I try to draw a map (using Maurizio Pisati's spmap), Stata "freezes" (no error message, just a popup from Windows saying that the programme stopped responding) . Drawing the two maps individually is not a problem. It is also possible to add Wales as a polygon to the base map of the English regions, but ultimately I would like to draw choropleth maps, so that is not a satisfying option.
Here's the code I'm using (in Stata 15.0):
Code:
shp2dta using Regions_December_2015_Full_Clipped_Boundaries_in_England, data(region_wow_shp) coor(region_wow_coor) genid(id) genc(c) replace shp2dta using countries, data(countryshp) coor(countrycoor) genid(id) genc(c) replace use countryshp, clear keep if ctry16nm == "Wales" rename ctry16nm rgn15nm rename ctry16cd rgn15cd drop bng_e bng_n replace id = 10 // IDs in region shapefile run from 1 to 9 append using region_wow_shp sort id save regionshp, replace use countrycoor, clear keep if _ID == 3 // Extracting the Welsh coordinates replace _ID = 10 // Assign the same ID as above append using region_wow_coor sort _ID save regioncoor, replace use regionshp, clear spmap using regioncoor, id(id) // This is where the programme stops responding
Comment