Fusion Tables

Kathryn Hurley
Developer Programs Engineer
Fusion Tables
@GoogleFT

Agenda


Quick Intro
Demo, Part I
Details & Examples
Demo, Part II
A couple more cool things

Fusion Tables - Quick Intro

A database in the cloud used to store and visualize your data.


*
* Source: Guardian
Demo, Part I

Upload a File

"Merge" (aka, Join)

Create a Map

Get Embeddable Code

The Details

Importing Data

Permissions

Merge and Search

Visualize

Importing Data

Fusion Tables Web Application

Shape Escape

Fusion Tables API

Web Application

http://www.google.com/fusiontables

Shape Escape

http://shpescape.com

API
  • REST API
  • SQL-like Query Language
def createTable(self):
  query = 'CREATE TABLE mytable (name: STRING, result: NUMBER)'
  encoded_query = urllib.urlencode({'sql': query})
  
  headers = {
    'Authorization': 'GoogleLogin auth=' + self.auth_token,
    'Content-Type': 'application/x-www-form-urlencoded',
  }
	
  serv_req = urllib2.Request(url='https://www.google.com/fusiontables/api/query',
                                        data=encoded_query,
                                        headers=headers)
  serv_resp = urllib2.urlopen(serv_req)
  return serv_resp.read()

http://code.google.com/apis/fusiontables/

Example Queries
CREATE TABLE mytable (name: STRING, result: NUMBER)

INSERT INTO 123456 (name, result) VALUES ('Kat', 12)

SELECT * FROM 123456 WHERE name = 'Kat'

UPDATE 123456 SET result = 13 WHERE ROWID = '301'

DELETE FROM 123456

DROP TABLE 123456
Permission Control
Merge
Search

Find other tables to merge with

Visualizing your data


Fusion Tables Web Application

Fusion Tables Layer,
Google Maps API

Google Visualization API

Web Application
FusionTablesLayer
map = new google.maps.Map(document.getElementById('map_canvas'), {
  center: new google.maps.LatLng(35.5, -122.2),
  zoom: 10,
  mapTypeId: google.maps.MapTypeId.ROADMAP
});
  
layer = new google.maps.FusionTablesLayer(123456, {
  map: map,
  query: 'SELECT Lat FROM 123456 WHERE result > 12'
});

http://code.google.com/apis/maps/documentation/javascript/overlays.html#FusionTables

FusionTablesLayer in Action

Google Visualization API
function changeData() {
  var query = "SELECT Year, Austria, Bulgaria, Denmark, Greece FROM 641716";
  query = encodeURIComponent(query);
  query = "http://www.google.com/fusiontables/gvizdata?tq=" + query
  query = new google.visualization.Query(query);
  query.send(getData);
}

function getData(response) {
  new google.visualization.BarChart(document.getElementById("visualization")).
      draw(response.getDataTable(),
           {title: "Yearly Coffee Consumption by Country",
            width: 600, 
            height: 400,
            vAxis: {title: "Year"},
            hAxis: {title: "Cups"}
      });
}
http://code.google.com/apis/charttools/index.html
Google Visualization API in Action
Google Visualization API in Action
Link to word cloud

http://visapi-gadgets.googlecode.com

Fusion Tables Example
Fusion Tables Example

Source: WikiEDData

Demo, Part II

Google Maps API

Google Visualization API

Protected Map Layer

Private tables in Fusion Tables Layer

Available with a Maps Premier License

Using Formulas

Population / AREA

Formula Example

FusionTablesLayer Builder

goo.gl/faZrv

Link
Questions?

?