Google Maps Mashups 7

John Harlin Live Google Map

 

American author and adventurer John Harlin has set out on an epic journey to follow the entire Swiss border under his own power, a 2,000km odyssey with more than 170,000m of climbing. You can follow John’s journey on swissinfo.ch’s John Harlin Live Google Map.

The map shows John’s current position (at the time of writing he appears to be approaching the Matterhorn). The map also includes the amazing photographs that John has taken on his journey, links to John’s daily reports and some of the interesting features and points of interest that John is passing on his epic journey.

 

Browse the New York Times by Location


You can now browse the New York Times by location using the Longitude Google Map.

Geotagged news stories are displayed on the map with a Times ‘T’ logo. If you click on a map marker an information window opens with ten recent articles from the paper for that location.

Beneath the map you can view a list of locations from today’s edition of the paper. Clicking on these links will also open the relevant information window on the map.

Read Write Web

Vermont Flooding 2011 Google Map

Google Crisis Response has released a Vermont Flooding 2011 Google Map.

The map shows road and bridge closures in the state. It is also possible to overlay other layers on the map showing:

  • cloud imagery
  • USGS Real-time Streamflow
  • significant river flood outlook
  • Red Cross shelters
  • Vermont county borders

Build a Google Map

Build-A-Map is a new Google Maps creation tool to help users build visually appealing, functionally rich, and interactive maps with minimal effort.

Using the simple point-and-click interface users can create custom maps, publish the map on Build-A-Map’s servers and then simply embed it in their own website or application. You can view examples of Google Maps created with Build-A-Map on the demo page.

Currently Build-A-Map is in beta testing. You can sign up now to be an early user.

The Circle Count Top 100 Google+ Users Map

Everyone knows that the real purpose of social networks is to gauge how popular you are by the number of followers you can collect. Circle Count is a new website that is tracking the most followed people on Google+.

Circle Count lets you enter your own Google+ profile and find your own Circle Rank based on the number of your followers. You can even get a button for your website or blog that shows how many followers you have on Google+. The application also provides a nice graph that shows your follower history.

The Circle Count Top 100 Google+ Users Map is a Google Map of the top 100 Google+ users worldwide (based on the number of followers). The top 100 is actually a pretty good list of some of the most important and influential players on the internet (and Ashton Kutcher).

If you want to follow Mark Zuckerberg, Larry Page, Sergey Brin, Pete Cashmore, Vic Gundotra (the top 5) or connect with other important people on Google+ then this is a pretty good place to start.

Map of New York Evacuation Zones

The New York Times’ New York City Hurricane Evacuation Zones Google Map shows the three evacuation zones in New York.

The zones are based on the strength of the hurricane making landfall. New York is preparing for the threat of storm surges with the closure of the entire public transportation system.

Climate Central has created a Google Map showing the areas in lower Manhattan, New Jersey and Brooklyn that are most at risk of storm surges from Hurricane Irene.

Yesterday Google released their Crisis Response 2011 Hurricane Season Google Map. Today they have created a map just for New York City: 2011 Hurricane Irene New York City.

The New York City map shows the forecasted track of Hurricane Irene as well as the evacuation zones and evacuation centers. It is also possible to view additional layers on the map showing:

  • Storm Surge Probabilities
  • The Red Cross National Shelter System
  • Cloud Imagery
  • Evacuation Routes

SQL Azure – Moving your data

 

Moving your data to the (public) cloud necessarily involves relinquishing some control over the setup and maintenance of the environment in which your data is hosted. Cloud-based hosting services such as Microsoft Azure are effectively just scalable shared hosting providers. Since parts of the server configuration are shared with other customers and (to make the service scalable) there is to be a standard template on which all instances are based, there are many system settings that your cloud provider won’t allow you to change on an individual basis.

For me, this is generally great. I’m not a DBA or SysAdmin and I have no interest in maintaining an OS, tweaking server configuration settings, installing updates, or patching hotfixes. The thought of delegating the tasks to ensure my server remains finely-oiled and up-to-date to Microsoft is very appealing.

However, this also has its own down-sides. One advantage of maintaining my own server is that, even though it might not be up-to-date or have the latest service packs applied, I know nobody else has tweaked it either. That means that, unless I’ve accidentally cocked something else up or sneezed on the delete key or something, a database-driven application that connects to my own hosted database should stay working day after day. When an upgrade is available I can choose when to apply it, and test to ensure that my applications work correctly following the upgrade according to my own plan.

Not so with SQL Azure.

Two examples of breaking changes I’ve recently experienced with SQL Azure, both seemingly as a result of changes rolled out since the July Service Release:

Firstly, if you use SQL Server Management Studio to connect and manage your SQL Azure databases, you need to upgrade SSMS to at least version 10.50.1777.0 in order to connect to an upgraded SQL Azure datacentre. This same change also broke any applications that rely on SQL Server Management Objects (including, for example, the SQL Azure Migration Wizard, resulting in the error described here). The solution to both these issues is thankfully relatively simple once diagnosed – run Windows Update and install the optional SQL Server 2008 SP1 service pack.

A more subtle change is that the behaviour of the actual SQL Azure database engine has changed, making it more comparable to Denali on-site SQL Server rather than SQL Server 2008 R2. Whereas, normally, upgrading SQL Server wouldn’t be a breaking change for most code (unless, of course, you were relying on a deprecated feature that was removed), the increase in spatial precision from 27bits to 48bits in SQL Denali means that you actually get different results from the same spatial query. Consider the following simple query:

DECLARE @line1 geometry = 'LINESTRING(0 11, 430 310)';
DECLARE @line2 geometry = 'LINESTRING(0 500, 650 0)';

SELECT @line1.STIntersection(@line2).ToString();

Previously, if you’d have run this query in SQL Azure you’d have got the same result as in SQL Server 2008/R2, which is POINT (333.88420666910952 243.16599486991572).

But then, overnight, SQL Azure is upgraded and running the same query now gives you this instead: POINT (333.88420666911088 243.16599486991646), which is consistent with the result from SQL Denali CTP3.

Not much of a difference, you might think… but think about what this means for any spatial queries that rely on exact comparison between points. How about this example using the same two geometry instances:

SELECT @line1.STIntersection(@line2).STIntersects(@line1);

SQL Azure query run in July 2011: 0. Same SQL Azure query run in August 2011: 1. Considering STIntersects() returns a Boolean, you can’t really get much more different than 1 and 0….

So, a precautionary tale: although SQL Azure hosting might have handed over the responsibility for actually performing any DB upgrades to Microsoft, the task of testing and ensuring that your code is up-to-date and doesn’t break from version to version is perhaps greater than ever, since there is no way to roll back or delay the upgrade to your little slice of the cloud.

The Email Settings and the Profiles APIs

Updating all signatures to make them adopt the same visually appealing style sounds like a perfect task to automate, however we’d still need to collect various pieces of information for each user, such as phone number or job title, and the Email Settings API has no knowledge of them.

The Google Apps Profiles API provides exactly what we are looking for and in the rest of this article we’ll see how to have the two APIs interact to reach our goal.

Let’s assume we want our signatures to look like the one in the screenshot below, with a bold name, italic job title and clickable link for the email address. Of course you can edit the style as you like with a bit of HTML skills:

Python is the programming language of our choice for this small script and we use the Google Data APIs Python Client Library to send requests to the Email Settings and Profiles APIs.

The first few lines of the script import the required libraries and set the values of the credentials that will be used to authorize our requests. You can find the consumer key and secret for your domain in your Control Panel, under Advanced Tools – Manage OAuth domain key. Remember to replace the dummy values in the script below with yours before running it:

import gdata.apps.emailsettings.client

import gdata.contacts.client

# replace these values with yours

CONSUMER_KEY = 'mydomain.com'

CONSUMER_SECRET = 'my_consumer_secret'

company_name = 'ACME Inc.'

admin_username = 'admin'

We’ll use 2-legged OAuth as the authorization mechanism and set the administrator’s email address as the value of the xoauth_requestor_id parameter, identifying the user we are sending the requests on behalf of.

The consumer key and secret plus the requestor id are the only parameters needed to create an OAuth token that we can pass to the Email Settings and Profiles clients:

# request a 2-legged OAuth token

requestor_id = admin_username + '@' + CONSUMER_KEY

two_legged_oauth_token = gdata.gauth.TwoLeggedOAuthHmacToken(

  CONSUMER_KEY, CONSUMER_SECRET, requestor_id)

# Email Settings API client

email_settings_client = gdata.apps.emailsettings.client.EmailSettingsClient(

  domain=CONSUMER_KEY)

email_settings_client.auth_token = two_legged_oauth_token

# User Profiles API client

profiles_client = gdata.contacts.client.ContactsClient(

  domain=CONSUMER_KEY)

profiles_client.auth_token = two_legged_oauth_token

Let’s define a class that generates the signatures for our users on the basis of a set of optional attributes (occupation, phone number, email, etc). This is the class you need to edit or extend if you want to change the style of the signatures for your domain. In the example below, the HtmlSignature() method simply concatenates some strings with hard-coded styling, but you may want to use a more elaborate templating system instead:

# helper class used to build signatures

class SignatureBuilder(object):

def HtmlSignature(self):

  signature = '%s' % self.name

  if self.occupation:

    signature += '%s' % self.occupation

  if self.company:

    signature += '%s' % self.company

  signature += 'Email: %s - Phone: %s' % (

      self.email, self.email, self.phone_number)

  return signature

def __init__(

    self, name, company='', occupation='', email='', phone_number=''):

  self.name = name

  self.company = company

  self.occupation = occupation

  self.email = email

  self.phone_number = phone_number

Let’s use profiles_client to retrieve a feed containing all profiles for the domain. Each call to GetProfilesFeed() only returns a page of users, so we need to follow the next links until we get all users:

# get all user profiles for the domain

profiles = []

feed_uri = profiles_client.GetFeedUri('profiles')

while feed_uri:

  feed = profiles_client.GetProfilesFeed(uri=feed_uri)

  profiles.extend(feed.entry)

  feed_uri = feed.FindNextLink()

At this point profiles will contain the list of users we want to process. For each of them, we instantiate a SignatureBuilder object and set its properties name, company, occupation, email and phone_number with the data for that user.

A call to the HtmlSignature() method of the SignatureBuilder instance will provide us with a properly formatted HTML-encoded signature.

# extract relevant pieces of data for each profile

for entry in profiles:

builder = SignatureBuilder(entry.name.full_name.text)

builder.company = company_name

if entry.occupation:

  builder.occupation = entry.occupation.text

for email in entry.email:

  if email.primary and email.primary == 'true':

    builder.email = email.address

for number in entry.phone_number:

  if number.primary and number.primary == 'true':

    builder.phone_number = number.text

# build the signature

signature = builder.HtmlSignature()

The Email Settings API client exposes a method called UpdateSignature to set the signature for a target user. This methods accepts two parameters, the username of the user to be affected and a string containing the signature. We just built the latter, so we only need the retrieve the unique username that identifies each user and that can be easily inferred from the entry identifier returned by the Profiles API, as described in the code and the comment below.

It is worth mentioning that you can also retrieve usernames with the Provisioning API, but for the sake of simplicity we’ll rely on this small hack:

# entry.id has the following structure:

# http://www.google.com/m8/feeds/profiles/domain/DOMAIN_NAME/full/USERNAME

# the username is the string that follows the last /

username = entry.id.text[entry.id.text.rfind('/')+1:]

It’s time to send the requests to the Email Settings API and update the signature:

# set the user's signature using the Email Settings API

email_settings_client.UpdateSignature(username=username, signature=signature)

For further details on what can be accomplished with the Google Apps APIs, please check our documentation .

The New Blogger

Blogger rolled out some nice new stuff this week. It’s different inside and out. As a heavy user of Blogger (you’re soaking in it!), I’m happy with anything that helps us make a better blog for you to read. If you have a Blogger blog of your own, here are a couple of the changes you’ll notice:

  • Each settings page has a button that starts a new post. Creating posts is what bloggers do most, and now you always can get to the post editor with one click.
  • You can see traffic and other stats in one place. The new Overview page shows you page views, comment activity, follower counts, and more.

For more information on what’s new in Blogger, and to find out how to turn on the new features, see this Blogger Buzz post.

Adding features to software is hard enough. Bumping celestial bodies around is another matter entirely. Hexi Baoyin of Tsinghua University has suggested giving a gentle shove to an asteroid so that it ends up in Earth orbit.

Google Maps Mashups 6

A cool Google Map mashup  of two French guys journey

Phillipe and Josue are two French guys who have taken a year’s sabbatical and decided to travel around the world. To help the world follow their journey they have created a cool Google Map of their journey that they call, 11 (onze) Mois sans toi(t)

The map shows all the stops that the pair have made on their journey so far. The information for each window includes Tweets, Facebook updates and photographs taken at that location. The map also includes the option for users of the map to add places of interest around the world that they think the guys should visit on their journey.

Your Story with Google Maps

I’m sure everyone has a story to tell – and you can tell yours with this Google Map.

Stories Unbound was created for the Melbourne Writers Festival. It is a social media platform (website and iPhone app), that lets users write and geotag stories wherever and whenever the mood strikes.

You can read submitted stories by selecting a marker on the map. It is also possible to select a story from the slide-out sidebar, where you can also submit your own story by selecting a location on the map.

The Google Maps interface for Stories Unbound uses Google Map Styles to create a map which is in keeping with the Melbourne Writers Festival brand. The clean look of the map, with most of the map labels removed, also creates a clean interface, which encourages the user to explore stories by location.

Google Maps for Flash

Google has announced that the Google Maps API for Flash has been deprecated. This means that no new features will be developed, and only critical bugs, regressions, and security issues will be fixed in the API.

Google says that “use of the Maps API for Flash remains a small percentage of overall Maps API traffic, with only a limited number of applications taking advantage of features unique to the Maps API for Flash.”

Perhaps the one unique feature available in the The Maps API for Flash and not available in the JavaScript API is the 3DMap object. The 3DMap object allows Flash map developers to create oblique map views and rotate Google Maps. It does seems to be a unique feature that was used very little.

The only map that I can remember that used this feature was a really cool application that let you create your own weather map. However the application no longer seems to exist. Luckily I did manage to video the application when it was released, so you can view the 3DMap object put to good use in the video below.

Sadly for map developers the Yahoo Maps API is also on the way out. From September 13th Yahoo will no longer support:

  • ActionScript 2 & 3 (Flash APIs)
  • AJAX Maps 3.6, 3.7, 3.8
  • REST API (Map Image API)
  • Simple API – (No coding)
  • GeoRSS – Version 2

Google Geo Developers Blog

Ghostly International Live Map

The record label and art company Ghostly International has created a Ghostly International – Live Map so that you can follow all their currently performing artists.

The Live Map lets you select an individual artist from the map sidebar and view all their upcoming events on a Google Map. When you select an artist from the sidebar an information window opens with a brief bio of the selected artist.

45° Imagery for 24 cities

Google Maps has had another big update of 45° (bird’s eye view) imagery. 24 new cities, including Lausanne, Switzerland and Girona, Spain, now have oblique view imagery in Google Maps.

To mark the occasion I have put together this Aerial View Slideshow, to highlight some of the best of the 45° imagery now available in Google Maps.

Google LatLong

Local Events with Google Maps

WeGooo is a Google Maps based application for finding nearby events.

Once you enter a location WeGooo displays a Google Map of the location with a time-line of nearby events. You can browse the events in chronological order from the time-line or find events by location by selecting a venue’s marker on the map.

It is possible to change your location on the map by dragging the ‘That’s me’ marker to a new position. If you select an event from the time-line the map will also display a route from your current location to the selected venue.

Fun with Google Maps

The Art of Running – A Tribute to Steve Jobs

Apparently someone called Steve Jobs got a new job this week, news of which seemed to send the world reeling. The news certainly seemed to have a strange effect on Joseph Tame.

Using his iPhone and RunKeeper Joseph set out to create a giant geoglyph of the Apple logo by running around Tokyo.

Don’t Pass Gas

City Slogans is a Google MyMap of witty slogans that towns in the U.S. have invented to try to entice you to visit.

Amongst the gems on offer is Hooker, OK with “It’s a location, not a vocation” and Algona, IA with “Home of the World’s Largest Cheeto”.

So Long and Thanks for all the Fish

The Google Maps Street View trike has taken a visit to Seaworld Orlando. On his visit he took a number of photographs including this shot of the performing dolphins.