I'm struggling with the Spanish municipality level.

I need to incorporate population data with the lat/long for each Spanish municipality and below are the details of my current files:

  • I cannot find one master CSV having population for each municipality, instead I have 52 files having population for municipalities within each Spanish province;
  • I have the lat/long for each municipality in a separate CSV, and
  • The problem is, I need a master CSV with all data in one place and my CSV files don't have an id I can use to map the data.
  • 2
    This is just a guess (from a QGIS perspective) as I cannot see or test your data but, assuming both your csv files contain a "municipality" column, you could add your lat/lon csv file as a Delimited Text Layer where you can select columns from the csv file as x/y coordinates. Then do a laborious task of combining the 52 population csv files into one (either copying/pasting or other means). Now from the GIS software, you should be able to do a JOIN with the added lat/lon file with the newly merged csv file by selecting the "municipality" column as the join and target field.
    – Joseph
    Aug 18, 2015 at 10:42
  • 1
    Hey Joseph thanks for the input. The problem here is that I do not have a municipality id that I can use to join. But I do have lat/long columns in both sets and I'm trying to join on the coordinates to no success Aug 19, 2015 at 5:31
  • What GIS software are you using? Please provide some more detail...
    – dru87
    Feb 29, 2016 at 13:24
  • Sorry for the delay in response; I was using QGIS and yes, I did finally figure the solution. Thank you so much! May 22, 2016 at 19:40

1 Answer 1


I don't know whether you're still after an answer to this problem. Anyway, I'm assuming you're using ESRI GIS. There probably is a similar method in case you're using different software.

What you're after is the spatial join tool. Try this:

  1. Load one set of csv-data into your MXD.
  2. Right-click the loaded table, hit display X/Y coordinates and select the fields with your Lat/Lon
  3. Right-click the data again, select data --> export data and save in a GDB or as a shape file.
  4. Repeat for your second data set.
  5. Navigate to your Analysis toolbox and select spatial join. Use the data set you want to join your data to as "Target feature". Add a search radius (in case your coordinates aren't identical). Select an output feature class and hit OK.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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