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.

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.

  • This is a simple spatial join which all GIS software should able to perform. What software do you have available to you? Edit: Are you looking for a spatial join or creating random points within the polygons? May 11, 2017 at 11:07
  • 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.
    – Henry Cann
    May 11, 2017 at 11:13
  • So if I understand you correctly, you have only a list of the areas, and not their polygon layer? With polygons, you could just calculate their centroids, thus getting some coordinates for each area.
    – Hynek G
    May 11, 2017 at 11:15
  • @HynekG That's right, although I've just noticed that different NUTS levels have been used for different countries. But still, the best way we think is to take polygon centroids using the correct level of polygons/NUTS?
    – Henry Cann
    May 11, 2017 at 11:25
  • 1
    Yes, in my opinion, if you are fine with any coordinates, then centroids are quite an easy solution. If you are able to obtain desired polygons, you are on the right track.
    – Hynek G
    May 11, 2017 at 11:37

2 Answers 2


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.

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.


You can use package geonames. After setting an account from here:


and enabling the free webservices from your profile page, you can do something like this:


options(geonamesUsername = "*your_username*")
places <- c("Niederösterreich", "Wien", "Kärnten")
get_coords <- function(name, country, fcode) {
  res <- GNsearch(name_equals = name, country = country, fcode = fcode)  
  out <- data.frame(name = res$toponymName, lat = res$lat, lon = res$lng)

GNresult <- places %>% 
  map(get_coords, country = "AT", fcode = "ADM1") %>% 

> GNresult
               name      lat      lon
1: Niederösterreich 48.33333    15.75
2:             Wien  48.2082 16.37169
3:          Kärnten    46.75 13.83333

You may however have to fiddle around with the parameters of the call to GNsearch within the get_coords function to get the results that you want (e.g., to set if you want coordinates of a city, an administrative region, etcetera). These are not documented within the package, but you can see http://www.geonames.org/export/geonames-search.html for reference.


  • Exactly the sort of thing I was looking for, I will be sure to check it out and come back to you.
    – Henry Cann
    May 12, 2017 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.