[GIS] Quickly assign coordinates to region names using R

coordinatesr

I'm wondering if there is any quick way anyone knows to assign long / lat coordinates to a list of regions without doing so manually.

I need coordinates which are simply contained by the region so it doesn't matter where the specific coordinates fall as long as they fall into the boundaries of the area.
So for example, given the list immediately below of Austrian regions, is there any way to do this? FYI, the reason I am looking for shortcuts is that overall I have something like 400 regions across Europe so manually assigning points could take time.

Burgenland  
AT12    Niederösterreich
AT13    Wien
AT21    Kärnten
AT22    Steiermark
AT31    Oberösterreich
AT32    Salzburg
AT33    Tirol
AT34    Vorarlberg

There may be no simple answer to this which I'm prepared to accept, but if anyone has any ideas please let me know?

I know about spatial joining but in this scenario I need coordinates first to be able to perform other sorts of analysis. At this point, I just need the coordinates. I use R Studio normally.

Best Answer

The best way I have found to quickly get lots of coordinates, since the countries in my dataset were spatially divided by a mix of NUTS 1, 2 and 3, was to find a dataset including all three.

You can find that at the following: http://ec.europa.eu/eurostat/cache/GISCO/geodatafiles/NUTS_2013_03M_SH.zip

The subsequent code then gets centroids (centre of mass) for each polygon then creates a new spatial points data frame, attaching data from the data slot of the original polygons data frame alongside the new centroid coordinates.

library(rgdal)
library(sp)
eu <- readOGR("NUTS_RG_03M_2013.shp")
centroids <- coordinates(eu)

centroids <- SpatialPointsDataFrame(coords=centroids, data=eu@data, 
                            proj4string=CRS("+proj=longlat +ellps=clrk66"))

If there are other and better approaches I would be glad to hear them, but this solution is here for anyone who needs it in future.