Setting Up Data for Geo Charts

Related Tags: geo dashboard reporting

GoodData’s Geo charts allow you to visualize data broken down by geographic region and to apply pushpins to the map based on data submitted to the project. This article covers how to prepare your data and logical data model for use with geo charts.

Contents:

Preparing Data

geo-charts
Example Geo chart

In order to display your data across regions on a map in GoodData, you’ll need a column in your data that relates data values to supported geographic regions. GoodData supports world countries, U.S. states, and U.S. counties. All available values for each type of region can be found in the linked reference files below.

Region type region_type Region ID type (region_identifier_type) Reference file
World countries worldcountries iso2 (e.g., US)
iso3 (e.g., USA)
name (e.g., United States)
worldcountries.csv
U.S. states usstates name (e.g., California)
code (e.g., CA)
geo_id (e.g., 0400000US06) - Census Area ID
usstates.csv
U.S. counties uscounties geo_id (e.g., 0500000US06097) - Census Area ID
uscounties.csv
*County and State columns are included just for reference. They cannot be used as a region identifier.
Czech Districts czdistricts name (e.g., Praha) - Name
name_no_diacritics (e.g., Praha) - Name without diacritics
nuts4 (e.g., CZ0110) - NUTS4
knok (e.g., 100) - KNOK
czdistricts.csv
Australia States ausstates name (e.g., Queensland) - Name
code (e.g., QLD) - ISO Code
ausstates.csv
  • Data for US States, Counties provided by US Census Bureau TIGER.

    Data for World Countries provided by Natural Earth.Read more about iso2 and iso3 country codes.

    Data for Czech Districts provided by ARCDATA.

    Data for Australia States provided by ABS.

Notice how U.S. states and U.S. counties have multiple identifier types that can be used to refer to any given region. Rather than upload reference files directly to the platform, select one of the identifier columns from the reference file and include it in the data that you will be uploading to your dataset (e.g., you could either use name or geo_id from the U.S. counties set as your preferred identifier).

NOTE: Region names must be in Sentence Case. ALL CAPS names are not permitted.

Consider the case where you’d like to create a Geo chart that displays sales data broken across U.S. states. Your pre-existing data would likely include an attribute with values corresponding to state names (e.g., California) or state codes (e.g., CA). The example below shows one possible way to formulate this type of data before uploading it to a project dataset. In this case, the name identifier is used to refer to different states.

Amount, Opportunity, Date Closed, State
132.2, My Opp, 2013-03-28, California
64.5, My Opp 2, 2013-03-23, Wyoming
....
  • Make sure that all of your state names (in the State column in your dataset) are identical to the state names in the reference file (column name in usstates.csv in this case).

Preparing the Logical Data Model

Besides preparing your data, you’ll also need to update the project’s logical data model to make regional attributes available in Geo charts. This is done by modifying the type of the attribute label (belonging to some attribute) that bears geo data to match the region type and region ID type of your data.

First, find the your regional attribute, containing geo data, in the Manage Page. Simply Click on Manage -> Choose attribute from the left column and find your attribute. See the picture below.

attribute label
Configuring geo chart attribute label

As you can see there an Edit button. After clicking on it, you are able to select the geo type that you need.

geo
Selecting geo type

After selecting it. Click on Save button and that’s all! Now you are prepared to create Geo chart widgets on your Dashboards. If you don’t know how to create a geo chart widget, see Using and Configuring Geo Charts on the GoodData support portal.

  • Setting the type of an attribute label to “geo” can be done easily in our web UI or using the API. It is not supported by the CL Tool, CloudConnect, or MAQL. We are working on adding this feature to CloudConnect anyway.

Configuring Geo Pushpins

In addition to segmenting map data by region, you can also apply pushpins to your maps. For example, you can define a set of pushpins to identify the latitude and longitude of retail stores.

Example geo chart with pushpins
Example Geo chart with pushpins

Configuring the geo pushpin attribute label

Geo pushpin data is sourced from an attribute label whose type is set to geo pushpin. Like the attribute label used to identify region data, you can change the type for this attribute label in the GoodData Portal.

NOTE: Before you begin, please verify that the logical data model contains an attribute label that you can use for storing pushpin information. The type of the attribute label must be configured within the GoodData Portal, and the attribute label must be created within the logical data model itself.

NOTE: You cannot configure the attribute label to be of type geo pushpin from within CloudConnect Designer or other interfaces. The following steps must be executed in the GoodData Portal.

Steps:

  1. To change the attribute label type, select Manage > Attributes in the GoodData Portal.
  2. Select the attribute whose label you wish to use to store geo pushpin data.
  3. For the label to use, select geo pushpin from the Type drop-down.
  4. Click the Edit link:
    Configuring geo pushpin type
    Configuring geo pushpin type
  5. Click Save.

Configuring geo pushpin data

Any data that is submitted through ETL containing pushpin information must be in the following format:

37.755919;-122.477711
37.492912;-121.992132

Each value of the attribute is in text form:

  • Values must be expressed in latitude;longitude form.
  • Positive values for latitude are in the northern hemisphere (negative in the southern hemisphere).
  • Positive values for longitude are in the eastern hemisphere (negative in the western hemisphere).
  • Values must be separated by semi-colons (;).
  • Do not include any spaces.