Sunday 27 September 2015

arcgis desktop - Joining shapefile table with csv


So I am having a shapefile with all the world countries. And the table for this shapefile has a column named "Country Name". Each of this entry is unique, meaning, each country takes only 1 row, and each with it's own polygon represented in the shapefile and ID.


Now I have a .csv file with all the countries again. Now this .csv file has the column "Country Name" too, but this column has several rows containing the same country name, because, it also has a column called "Year", therefore each country has several row entries for each year.


How can I join my shapefile table with this .csv table? Right now, my problem is that when joining, only the first entry from the .csv file is being joined, since the shapefile table only has 1 row per each country entry.


Any suggestions how I can a union join, meaning that each country in my shapefile will be assigned every year found in the .csv file? I think it means that each polygon needs to be multiplied for every year entry from the .csv file.


Thanks


EDIT: According to ArcGIS Resources - joining and relating tables, "In all cases of 1:M joins, only the first matching record is joined and displayed in the layer's attribute table.". Which is actually the problem I have. Only the first matching record is displayed in my shapefile table.


So I believe I now need a work around? Since my .csv is having my data by year, but each year is a row (and the same country is spanning several rows for each year row), would I need to create a column for each of the years, and somehow transfer the data found in each row from my .csv file to the columns of my shapefile?





No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...