Tutorials‎ > ‎

2. Make a KML from two data sources

If product changes have made the details on this page incorrect, please tell us at: googletables-feedback@google.com.

Related Demo script
Demo: Make a KML from 2 data sources

Example of completed exercise

Topics covered
  • Attribution
  • Public Data
  • Image support
  • Fusion
  • Column control
  • Mapping
  • Bubble customization - template 5
  • Export to KML file


Sign in to Google Fusion Tables

  1. Go to http://tables.googlelabs.com in your browser
  2. Optional: click through the Tour
  3. Sign in with your Google Account
    1. Need a Google Account? you can make one with any e-mail address by adding a password to it.
    2. Click the "Create a Google Account" link on the sign in page.  
  4. You should now see a list of tables

Find "African Heads of State" data among public data 

  1. Click "Public tables" to see data tables that Google Fusion Tables users have selected to make public. 
  2. In the search box, type [african heads of state] and hit Search Tables
  3. Find the table called "African Heads of State". Click to open it.
  4. Optional: View the original data table at JapanAfrica.net

Find images of Country Flags data

  1. Open a new browser tab or window, and go to http://tables.googlelabs.com.
  2. Click "Public tables" to see data tables that Google Fusion Tables users have selected to make public. 
  3. In the search box, type [Country Flags] and hit Search Tables
  4. Find the table called "Country Flags - Large"
  5. Click to open it.
  6. Optional: Click on a flag to see the URL where the image is hosted. This is how Google Fusion Tables supports images.
  7. Optional: Click Visualize > Map to see the extent of data set
  8. Copy the URL for this table.

Merge select columns from two data sets

The two tables have different numbers of rows. When they are merged, out of the entire list of country flags only the list of matching African countries will be part of the new table. 

  1. From within the "African Heads of State" table, click Merge
  2. Paste URL into "Merge with:" and click Get. 
  3. Select the "Country" radio button for both tables ("COUNTRY")
    1. Tip: don't use COUNTRY, as the capital letter spelling of country names won't match any country names from the Flags file. 
    2. Tip: Although the column names are identical in this exercise, It's not necessary for the columns to be named the same in order to merge on them.
  4. Optional: Exclude the unneeded COUNTRY column.  
    1. Check "Select columns" checkbox on left
    2. Un-check "COUNTRY" column.
  5. Enter a name for the new merged table (eg. "African Heads of State and Flags")
  6. Click "Merge tables"
Take a moment to look at the new table that results. 
  • The columns coming from different source tables have slightly different background colors.
  • Both sources are attributed in the table header.
  • Under File > About, the lineage of the data in the merged table is available in greater detail.

Show combined data on a Map

  1. Visualize > Map
  2. Click on a map pin to see the default bubble style

Customize the Map information bubble

  1. Click "Configure Info Window"
  2. Select "template 5" and specify the information that should be used to populate the info bubble template
    1. specify "Country" as Title
    2. specify "HEADS" as paragraph 1
    3. specify "Flag" column as photo link
    4. specify "table attribution" as either the "read more" text or the "photo caption"
    5. Press Save
  3. Click on a map pin to see the template in action.

Export to KML and view in Earth

  1. Click "Export to KML"
  2. At the download prompt, select to open the file with Google Earth. Or, double-click to open the file after downloading it.
This should launch Google Earth and display the same map pins with the templated bubbles.

Bonus: View on Google Maps

  1. Click "Get KML network link" 
  2. Copy the text that appears. This is the URL where Google Fusion Tables will host the KML
  3. In a new browser window or tab, go to http://maps.google.com
  4. Paste the KML address into the Search box 
  5. Click Search Maps
Because this visualization calls back to Fusion Tables each time it is displayed, it will reflect any changes made to the underlying data table. 

While viewing the KML on Google Maps, you can...
  1. Use the "Link" feature to e-mail the map to someone so they can view it without Google Earth or Fusion Tables. 
  2. Use the "Link" feature to embed the map in your website. 
  3. Save the points to My Maps.

Rebecca Shapley,
Nov 2, 2009, 6:53 AM