Joining Non-Geospatial Data

At times it may be necessary to add data to an existing layer by cross-referencing that data with another table. Cartographica does this by matching columns in an existing layer with data from a file and adding the new data to features which match. This operation is called a join in database parlance and by some GIS packages.

To join data, use the Map To column to specify the destination column for the imported data (or New Column if you want to add a new column for the imported data). Matching criteria is specified by checking the Key box next to a column. Checking more than one Key box will only add the data when all Key fields match.

As an example, here is some existing Polygonal data (Example Data A) for three Counties that exist in two different States:

County Name

State Name

Area (Sq KM)

Floyd

Kentucky1,020
LoudonVirginia1,347
FloydVirginia

989

Example Data A - Original Data

Note that Floyd counties exist in both states

Here is the data you want to join with the above data (Example Data B):

County NameState Name1990 Census Population2000 Census Population
BarrenKentucky38,03330,033
AdairIowa8,2438,244
FloydKentucky42,44140,441
FairfaxVirginia1,077,0001,099,000
LoudonVirginia169,599269,599
Example Data B

Here is the result of performing the Join of Example Data B to Example Data A using County Name and State Name columns as keys:

County NameState NameArea1990 Census Population2000 Census Population
FloydKentucky1,02042,44140,441
LoudonVirginia1,347169,599269,599
FloydVirginia989

Result of original then joined by County Name and State Name as key

In the final table, the extraneous data supplied in Example Data B \(Adair, Iowa and Barren, Kentucky) which did not match entries in the existing table is discarded. Further, the lack of data about Floyd, Virginia resulted in empty columns.

Note that if only the County Name was used as a key and all other columns were matched, then both Floyd counties \(the one in Virginia and the one in Kentucky would have values set in all columns, including replacing the State Name column. However, the explicit use of a multiple key means that Cartographica will only consider a match when all elements match.

County NameState NameArea1990 Census Population
FloydKentucky1,02042,441
LoudonVirginia1,347169,599
FloydKentucky98942,441
Result of original joined with just County Name key

In the case that a feature in the layer matches multiple rows in the joined table, each row from the table will replace columns in succession, resulting in the final feature data matching the last matching row in the table.