Resolving Geographical Data
When you specify a geographical field, the data binding attempts to resolve values in the field against the corresponding layer in the map database. If all data values are successfully matched, a green check mark is displayed. If some data values cannot be matched, a red question mark (“?”) is displayed.

When the data binding cannot automatically match your geographical data to the locations in the geographical database, you can use the 'Geographic Mapping' dialog box to manually create the correct mapping.
To set the mapping for geographical data, follow the steps below.
1. Click the red question mark. This opens the 'Geographical Mapping' dialog box.
a. Select one of the unmatched names in the top-left panel. The right panel displays a list of candidate matches.
b. If the list does not contain the intended match, select another matching method from the 'Algorithm' menu.
c. Select the correct match and click the 'Add' button.

This creates the desired mapping between the data value and the geographical information in the map database.
4. Repeat the above steps until all values have been matched.
5. When you have completed making all matches and the left panel is empty, click 'OK' to close the dialog box.
6. Click the 'Apply' button in the geographical editing panel.
In this example, you will create a Worksheet Data Block that contains state names that have an unusual format. Because of the unusual format, you will need to manually map these state name to the correct geographical locations.
This example assumes that you are familiar with Data Worksheets, and requires some scripting. See Creating an Expression/Formula Column in Data Mashup for complete information.
1. Click the 'Open' button in the Style Studio toolbar.
2. In the 'Open' dialog box, select the Worksheet tab.
3. Expand the 'Tutorial Folder' and select the 'US Sales' Worksheet. Click 'OK' to open the Worksheet.
4. Save a copy of the worksheet as 'US Sales Copy'. (See Data Mashup for details on opening and saving Worksheets.)
5. In the 'US Sales Copy' Worksheet, create a formula column that contains variations of the state names in the 'State' column. Follow the steps below:
a. Click the 'Create Expression' button in the title bar of the 'Sales' table.

b. When Style Studio prompts you for the expression name, enter 'New State' for 'Expression Name'. Click 'OK' to open the Formula Editor.
c. Deselect the 'SQL' option. The formula will use JavaScript syntax rather than SQL.
d. In the Formula Editor, enter an expression that will change two of the names in the 'State' column:
if (field['State'] == 'NJ') {
'Jersey';
}
else if (field['State'] == 'CT') {
'Conn';
}
else {
field['State']
}
This simply changes the values 'NJ' and 'CT' to 'Jersey' and 'Conn' in the expression column, respectively, leaving all other state values the same.
Note: Click the 'Show Live Data' button in the table title bar to view the actual data.
e. Click 'OK' to exit the Formula Editor. This creates the new column called 'New State'.

6. Save the Worksheet.
7. Create a new report, and add a chart.
8. Click the chart to select it. This opens the Data panel and Binding panel.
9. In the Binding panel, click 'Select Chart Style', and choose the 'Map' chart type. Click the 'Apply' button (or double-click the 'Map' icon).

The Binding panel changes to display a 'Geographic' field.
If your columns contain longitude and latitude data (in decimal format) rather than location names, use the 'Longitude' and 'Latitude' fields of the 'Data' panel.
10. In the Data panel, expand the 'Global Worksheet' node, and expand the 'US Sales Copy' Worksheet.
11. Drag the 'New State' dimension onto the 'Geographic' region in the Binding panel.
Note the red “?” that appears beside the field name. This indicates that at least some geographical names in that field could not be successfully matched.
12. Click the red “?” to open the geographical editing panel.
13. Select 'U.S.' from the 'Map' menu, and select 'State' from the 'Layer' menu.

14. Click the red “?” next to the 'Mapping' field to open the 'Geographical Mapping' dialog box.

Observe that in the left panel of the 'Geographical Mapping' dialog box, two states are not mapped: 'Jersey' and 'Conn'.
15. Resolve these unmatched states manually. Follow the steps below:
If the suggestions are unsatisfactory, select a different matching method from the 'Algorithm' menu.
a. In the left panel, select the state 'Conn'. The right panel suggests a set of likely matches.
b. Select the correct match ('Connecticut'), and click the 'Add' button. This creates a new mapping between the value 'Conn' and the location 'Connecticut', and removes 'Conn' from the left panel.
c. Click 'Jersey' in the left panel. The right panel suggests a set of likely matches.
d. Select the correct match ('New Jersey'), and click the 'Add' button. This creates a new mapping between the value 'Jersey' and the location 'New Jersey', and removes 'Jersey' from the left panel.
5. Since all unmatched locations have now been resolved, click 'OK' to close the 'Geographic Feature Names' dialog box.
6. Click 'Apply' in the geographical editing panel for the 'New State' field.
7. In the Data panel, drag the 'Quantity Purchased' measure from Worksheet to one of the 'Visual' regions ('Color', 'Shape', etc.) in the Binding panel.
8. Preview the report to display the completed map chart.

| << 6.6.5 Binding a Chart to Geographical Data (Map) | © 1996-2013 InetSoft Technology Corporation (v11.4) | Using Latitude and Longitude Data >> |