Friday, April 6, 2012

Getting Started with Google Fusion Tables









Google Fusion Tables : Other Features

Sharing:
To let others view this map you need to share it using the “Share” button on the right of the screen there is a share button; click it. You'll see that this table is set to private, so you will have to change it to Unlisted or Public in order to have it viewed in your website.

If all of the addresses were not translated to a map location:
Click the Visualize menu and select "Table"; you'll see the rows that were not translated are still highlighted in yellow. Click the globe icon next to the address and you'll be able to manually search for and select a matching location.
Note: In our example the data from the first two columns latitude and longitude has been used for plotting so the location column is highlighted yellow.

Configure the InfoWindow
Change how the content is displayed in the InfoWindow.
1.    Click on Configure info window.
2.    Select Custom in the drop-down menu next to Info Window Template:.
3.    In the text area under Custom Html, you can enter any HTML and inline CSS to format the InfoWindows. Data from the table can be included by entering the column name surrounded by curly brackets.     
 4.   Click Save.

Embedding Your Map into a Webpage
1. First, change the visibility of the table to Unlisted or Public to embed in a web page. To change the visibility of the table:       
  • Click the Share button in the top right corner.
  • Select the radio button next to Unlisted or Public. 
  • The visibility will be updated immediately on selection.     
2. Click on the Get embeddable link above the map.
3. Copy the HTML code in the text area that is displayed.

Displaying images
Fusion Tables doesn't store images.To display images, enter the URL pointing to the location of the image on the Internet in a cell in Fusion Tables.
To see image thumbnails in the Table:
1.    Click the Edit menu and select Modify columns
2.    Click the column name that contains the URL to the images.
3.    On the right, click the Format menu and select a format.
4.    Click Save.

Filtering and aggregating data:
To filter your data:
1.    Click the "options" link above the table or visualization. You see three tabs: Filter, Aggregate, and Create view.
2.    Click Filter.
3.    Give a condition.You can give more than one conditions by clicking on "Add Condition", each of which is an "AND" condition.
4.    Click Apply.
Except for "contains case insensitive," filters are case-sensitive and  match exactly on capitalization. Only the rows that match the criteria are shown.
To aggregate your data:
1.    Check one or more columns to compute aggregates for: max, min, average, sum.
2.    Choose which column to group by.
You also need to select aggregates to compute. Aggregation operators only work on numeric columns. A count of the number of rows in each group always appears in the result, so there is no need to specify it explicitly.

Using the "matches" filter:
"Matches" is based on SQL's LIKE, and therefore provides some basic pattern matching functionality.  Use the underscore  _ for a one-character wildcard, and % for a wildcard that matches any number of characters. 

Displaying video
Just like images we can display videos.Fusion Tables doesn't store videos. Host the video on YouTube and use the appropriate embed code.
To have videos display in the table view in Fusion Tables:
1.    get the "old embed code" for the video. Embed code that starts with "<iframe..." will not work; it needs to start with "<object...".
2.    Paste the code into the table cell in Fusion Tables.
3.    Under the Edit menu, select Modify Columns.
4.    Select the column with the video embed code, and make sure it is type Text.
5.    Under Format, select "8 line image".
6.    Click Save.

Using Google Fusion Tables: Hands on Example

1.Get your data
Fusion Tables can import a file of up to 100 MB of these file types:
●    Spreadsheets (.xls, .xslx, .ods)
●    comma-separated text (.csv)
●    other text-delimited files (.tsv, etc)
●    KML (.kml).
●    Google Spreadsheets

For this tutorial we will use an excel file which is available at the link:  http://bit.ly/Hnayz2
The excel file consists of twitter details of the  followers of Sony India ( @sony_india ) and followers of LG India ( @ lgindiatweets ). Sony India data is identified by a value 1 in company column and LG India is identified by value 2.
The twitter data has been downloaded from http://www.twittersave.tk where we have implemented a php script to download the data.
You can use any other data.


2.Log in to Google Fusion Tables
Go to http://www.google.com/fusiontables and Click on “SEE MY TABLES” button on the right.

3.Sign in / Sign up using your google account.Then click on “Create”, then “Table(beta)”.


4.Now there are three option:
  • From this computer
  • Google Spreadsheet
  • Create Empty Table


5.So select the first option “From This Computer” to upload a file from your computer and click on “Next”.
Now specify the columns to import and click “Next”. For this tutorial we have selected all the columns.

Give other details about your data if you want to and click “Finish”.
 
6.Now you will see the data in Table format. Notice that the location column has been highlighted, which means that Fusion Tables has identified the location data in your table. If your data does not have a column highlighted in yellow, that means that the Fusion Tables wasn't able to automatically pick a column that specified a location. 
To do this, click the “Edit” menu, then select “Modify Columns”. From here you will click on the column that holds your location data. After clicking, on the right you will see a drop down list labeled Type. Select Location from the drop down list, then click Save in the bottom left of this screen. After this, your column should be highlighted yellow.



7.Now the data can be visualized. Go to Menu there are options for File, View, Edit, Visualize, Merge, Experiment. Click "Visualize" and then select "Map". Your address data is now automatically translated into a map location(geocoding) and a map marker is placed on a Google Map for each valid location.

Note: Geocoding may take some minutes to complete in case of larger data. So the data which we are using already consists of the latitude and longitude information in the table which has been obtained using the following excel tool which uses yahoo geocodes:
http://bit.ly/excelgeo
 


8.The resulting map can be seen at:
http://bit.ly/HnQVHF

9.Before we end, one last thing, since we have data of two different companies it is  possible to represent the data on the map in a manner that followers of the two companies can be differentiated.



Styling
  • Click on Configure styles
  • Select Marker icon under Points in the left column.
  • Select the Buckets tab.
  • Select the radio button next to Divide into.
  • In the drop-down menu next to Divide into , select 2.
  • In the drop-down menu next to Column , select company.
  • In the text box next to Lines, enter the number 1 in first and 2 in the one below it. Select the colors red and yellow corresponding to 1 and 2.
  • Click the Save button.



10.The output can be seen at:
http://bit.ly/mapfusion

The map shows the relative distribution of the followers of the two companies which can help determine the popularity of the two brands as per geography.


Google Fusion Tables

Visualize and publish data as maps, timelines and charts
Google Fusion Tables is a cloud-based data management service focused on visualizations and collaboration which was launched in June 2009. The success of Fusion Tables can be attributed to its features, which enable users to upload tabular data files and provide several ways of visualizing the data which include maps, charts, graphs and timelines. It also has the ability to filter and aggregate the data. It supports the integration of data from multiple sources by performing joins across tables that may belong to different users. The goal of Fusion Tables is to manage larger amounts of data and focuses more on bulk operations on the data (filtering, aggregation, merges). Users can keep the data private, share it with a select set of collaborators, or make it public.


Why use Google Fusion tables?
• It enables data visualization which makes it easier to sense the data efficiently and make decisions faster.
• Simplicity.
• Able to handle all types of location data.
• Easy data integration and collaboration.
• A deep integration into Google maps & Google charts infrastructure.
• Easy website/blog integration.
• The Fusion API allows developers to programmatically perform a variety of tasks, including update and query.