Resolving Geographical Data

When Visual Composer 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. In the Chart Editor, right-click the desired geographical field, and select 'Edit Geographic' to open the editing panel. (See Setting a Geographical Field for more information.)

The Chart Editor attempts to resolve values in the selected geo­graphic 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.

2. To resolve any unmatched names, click the red question mark. This opens the 'Geographical Mapping' dialog box. In the 'Geographical Mapping' dialog box, follow the steps below:

a. Select one of the unmatched names in the top left panel. The right panel will display a list of candidate matches. (If the list is very long, type a portion of the name in the search box above the panel to limit the results.)

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.

3. Repeat the above steps until all values have been matched.

4. When you have completed making all matches, and the left panel is empty, click 'OK' to close the dialog box.

5. Click the 'Apply' button in the geographical editing panel.

Example: Resolving Geographical Data  >>

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. Open the 'US Sales' Worksheet from the 'Tutorial Folder'.

2. Save a copy of the Worksheet as 'US Sales Copy'.

3. In the 'US Sales Copy' Worksheet, create a formula column that contains variations of the state names in the 'State' column. To do this, follow the steps below:

a. Click the 'Create Expression' button in the title bar of the 'Sales' table.

 

b. When Visual Composer 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'.

 

4. Save the Worksheet.

5. Create a new Viewsheet based on this 'US Sales Copy' Worksheet.

6. Add a Chart to the new Viewsheet, and click the 'Edit' button on the Chart to open the Chart Editor.

7. In the Data panel of the Chart Editor, click the 'Select Chart Style' button, and choose the 'Map' type.

8. In the Data Source panel of the Chart Editor, right-click the 'New State' field, and select 'Set Geographic'. This opens the geographical editing panel.

 

9. Click the red question mark 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'.

10. 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'. In the right panel, Visual Composer 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.

a. Click 'Jersey' in the left panel. In the right panel, Visual Composer suggests a set of likely matches.

You can start typing “Jersey” in the search box to limit the results.

b. 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.

11. Since all unmatched locations have now been resolved, click 'OK' to close the 'Geographic Feature Names' dialog box.

12. Click 'Apply' in the geographical editing panel for the 'New State' field.

13. Drag the 'New State' field from the Data Source panel to the 'Geographic' region of the Chart Editor Data panel.

14. Drag the 'Quantity Purchased' measure from the Data Source panel to one of the Visual panel regions ('Color', 'Shape', etc.) to complete the chart.

 

<< 4.5.1 Creating a Map Chart © 1996-2013 InetSoft Technology Corporation (v11.4) Using Latitude and Longitude Data >>