3.6. 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:

Table 3.1. Example Data A - Original Data

 County Name State NameArea (Sq KM) 
FloydKentucky1,020
LoudounVirginia1,347
FloydVirginia989

(Note that Floyd counties exist in both states)

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

Table 3.2. Example Data B

County Name  State Name 1990 Census Population 2000 Census Population
BarrenKentucky38,03330,033
AdairIowa8,2438,244
FloydKentucky42,44140,441
FairfaxVirginia1,077,0001,099,000
LoudounVirginia169,599269,599

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:

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

County Name State Name Area 1990 Census Population 2000 Census Population 
FloydKentucky1,02042,44140,441
LoudounVirginia1,347169,599269,599
FloydVirginia989  

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.

Table 3.4. Result of original joined with just County Name key

County Name State Name Area 1990 Census Population 2000 Census Population 
FloydKentucky1,02042,44140,441
LoudounVirginia1,347169,599269,599
FloydKentucky98942,44140,441

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.