Obtaining geocode information from attribute values

You can create a full set of geocode attributes (country, region, subregion, etc.) based on any String attribute that has partial address information. The full set of geocode attributes allows you to display the geographic information in a Thematic Map.

For details about using the geocode attributes in a chart, see Thematic Map. For details about using geocode (geotag) functions and their data type requirements, see Enrichment functions.

To obtain geocode information from attribute values:

  1. In the Catalog, select a project.
  2. Select Transform.
  3. Locate an attribute, of type String, that has geographic information.
    For example, this might be a city, state, or postal code attribute.
  4. From the transform menu, select Advanced > Create geo heirarchy.
  5. In Select a <location> attribute..., do one of the following depending on your data set:
    (where <location> represents each control such as country, region, subregion, city and postcode)
    • If your data set already has a <location> attribute, select Attribute from the list and specify the attribute name.
    • If your data set does not have a <location> attribute, create a country attribute manually by selecting Static Value from the first list and selecting a country name from the second list.
    • If the attribute is not applicable, select N/A. In other words, this attribute may be unknown; it may not exist, or may not apply. For example, some countries do not have providences, states, or counties.
    • Repeat this step to specify the values of Select a country attribute..., Select a region attribute..., Select a subregion attribute..., Select a city attribute... and Select a postcode attribute....
  6. In New Attribute Name (prefix), specify just the prefix value for the new geocode attributes.
  7. Decide how to handle ambiguous location matches in the new geocode attribute values by selecting one of the following:
    • Return the most populated relevant location - sets the ambiguous value to the most populated location match. For example, an ambiguous match to Boston is set to Boston Massachusetts rather than Boston, Georgia.
    • Return a null value - sets the ambiguous value to null.
  8. Either click Preview to see the previewed results of running the transformation, or click Add to Script to save the transformation step to the script.

Example 19-1 Example

Suppose your source data has attributes named city, county, and zip_code with values that represent city names, county names, and postal codes in the state of California:
A table view with only three attribute columns

However, the source data does not have country or state information. You can create the geocode attributes by setting the Create Geographic Heirarchy as follows:
Shows a fully configured Geoheirarchy Tagger

After you click Preview, you see that Studio created the following new geocode attributes highlighted in yellow:
Shows a table view of the five new geocode attributes

If you are done making changes to the project data set, you can commit the changes. See Running the transformation script against a project data set.