Documents List API

 

There are a number of ways to add resources to your Google Documents List using the API. Most commonly, clients need to upload an existing resource, rather than create a new, empty one. Legacy clients may be doing this in an inefficient way. In this post, we’ll walk through why using resumable uploads makes your client more efficient.

The resumable upload process allows your client to send small segments of an upload over time, and confirm that each segment arrived intact. This has a number of advantages.

Resumable uploads have a customizable memory footprint on client systems

Since only one small segment of data is sent to the API at a time, clients can store less data in memory as they send data to the API. For example, consider a client uploading a PDF via a regular, non-resumable upload in a single request. The client might follow these steps:

  1. Open file pointer to PDF
  2. Pass file pointer and PDF to client library
  3. Client library starts request
  4. Client library reads 100,000 bytes and immediately sends 100,000 bytes
  5. Client library repeats until all bytes sent
  6. Client library returns response

But that 100,000 bytes isn’t a customizable value in most client libraries. In some environments, with limited memory, applications need to choose a custom chunk size that is either smaller or larger.

The resumable upload mechanism allows for a custom chunk size. That means that if your application only has 500KB of memory available, you can safely choose a chunk size of 256KB.

Resumable uploads are reliable even though a connection may not be

In the previous example, if any of the bytes fail to transmit, this non-resumable upload fails entirely. This often happens in mobile environments with unreliable connections. Uploading 99% of a file, failing, and restarting the entire upload creates a bad user experience. A better user experience is to resume and upload only the remaining 1%.

Resumable uploads support larger files

Traditional non-resumable uploads via HTTP have size limits depending on both the client and server systems. These limits are not applicable to resumable uploads with reasonable chunk sizes, as individual HTTP requests are sent for each chunk of a file. Since the Documents List API now supports file sizes up to 10GB, this is very important.

Resumable upload support is already in the client libraries for Google Data APIs

The Java, Python, Objective-C, and .NET Google Data API client libraries all include a mechanism by which you can initiate a resumable upload session. Examples of uploading a document with resumable upload using the client libraries is detailed in the documentation. Additionally, the new Documents List API Python client library now uses only the resumable upload mechanism. To use that version, make sure to follow these directions.

The New KML features in Google Earth 6.1

In the recently released Google Earth 6.1 we added two new features that will help you annotate line data and improve KML Tours that include Street View mode. As a part of Google’s ongoing commitment to innovation within the standard, these were added to the gx: namespace using the official extension mechanism for OGC KML.

 

Line labels

When Earth 6.0 launched last November we introduced line styling options to create more realistic roads that have a physical width, outer coloring, and text labels. Now with Google Earth 6.1 you can also add simple text labels at the midpoint of regular (screen <width>) lines by using the new <gx:labelVisibility> tag in <LineStyle>.

Caption: Labeled line between SFO and LAX airports.

Download the KML.

 

Note: To preserve the current, unlabeled appearance of regular lines in existing KML files, we’ve turned off all line labels by default in Google Earth 6.1. Because labels for physical width lines were turned on by default in Earth 6.0, you will now need to explicitly enable in your LineStyles to display them in Earth 6.1+.

 

Better Street View experience in Tours

Last November we also introduced <gx:ViewerOptions> in Earth 6.0 so that KML Tours can activate the historical imagery, sunlight and Street View modes, allowing you to tell even cooler stories.

Street View mode uses a different field of view (FOV) than the regular navigation mode to provide users with a better experience. However, until now this special FOV was not captured while creating Tours in Google Earth. This meant that tour playback couldn’t faithfully reproduce the Street View experience as originally recorded.

To address this issue in Google Earth 6.1 we added the <gx:horizFov> tag to <Camera> and <LookAt>. These values are captured automatically while recording tours in Earth 6.1 but you can also add them directly to your KML.

 

Caption: Here’s an example of using to create the classic dolly zoom effect, invented by cameraman Irmin Roberts and used in Alfred Hitchcock’s film Vertigo. Download the KML here.

Note: Although Cameras and LookAts can also be used to provide a default view for your placemarks, please note that in Google Earth 6.1 custom FOV values are only respected within the <gx:FlyTo> tags in tours.

 

Keller on Letting It Go

 

“When one door of happiness closes, another opens; but often we look so long at the closed door that we do not see the one which has been opened for us.”

– Helen Keller (1880–1968)
American humanitarian
Advocate for the deaf and blind

 

What are the most common “drag you down, get in the way of success” thoughts?

  • Defeatist (accepting, expecting, or being resigned to defeat)
  • Cynical (contemptuously distrustful of human nature and motives)
  • Vindictive (seeking revenge)
  • Blame/ Fault (who cares? what are we going to do now?)
  • Wishful (do what you can to influence the deal and keep moving)