It is possible to attach your data to an existing map layer. This could be useful to display shaded area maps using Maptitude’s built-in geographic definitions (e.g. “shade zipcodes according to my data”). Similarly, you could add data columns to existing point data whether it is supplied with Maptitude (e.g. cities) or your own data that you have imported (e.g. customers). This process of attaching data from one table (data view) to another view (e.g. a layer) is called a Join.
In this example we will join a data view that we have imported from Excel, to the built-in State layer, and display the results as a shaded area map. The input data lists Weather Risk as an index for each US State. It is derived from Microsoft MapPoint 2006.
First, load the data into Maptitude using File->Open. Maptitude will not recognize this as geographic data but it will import it into a Data View:
This Data View has three columns: State (name of the State), Country (all US), and the weather index. We wish to join this table to the State table (and layer) using the State name. The resulting joined view will resemble the original State layer but also include the Weather Risk column. We can then plot the State layer using the weather risk to set the theme style (i.e. shade according to the weather risk).
Create the join by selecting Join… on the Dataview menu. This will display the following dialog box.
Set the name for the new joined view. The default is usually good enough but we have cleaned it up slightly here. Select the table for left side of the join (i.e. the layer’s table: State) and the field to use in this table. Although the State table contains a field called ‘State’, this is a numeric identifier. We want the ‘Name’ field which stores the full name of each State.
Similarly for the right side of the join, we select our Data View table (Weather Risk) and the field for the name (State).
The Options tab contains a number of options to handle situations where a one-to-one join is not valid. It can also perform a number of aggregate calculations including Sum, Average, Minimum, and Maximum. We do not need these features.
Press OK, and Maptitude will create the new joined view. The new columns in the joined view will look like this:
Note that all of the columns have been added even though we only really needed one.
We have completed our join. However the map has not changed. Now we need to change the theme for the State layer. In the Display Manager open up the State layer. Make sure it is enabled (green check), but under Sets, set ‘Selection’ to be disabled (red cross). This will ensure the State layer is displayed but our new theme is not hidden by the selection (if any). Right click on the layer and select Make working layer from the popup menu. Then select Color Theme… from the Map menu to display the Color Theme dialog box for the current layer:
This dialog box defines a basic color theme. For polygon (area) layers such as the State layer, it will set the color shading for each of the layer’s shape. Set the Field to use our newly joined Weather Risk field. Then set the other values as appropriate. In the above image we use Maptitude’s default of eight color ranges.
The Styles tab lets you define the individual styles for each of these ranges. We choose the default (a series of green shades). However you could change the colors and legend in any way you wish. You can also save a theme for use at a later date.
Once we are happy with the theme definitions, press OK, and Maptitude will color the States layer:
We have successfully shaded the US states according to a data table which we imported from Excel.