The online JavaScript API of Google Earth Engine

What used to be the stuff of science fiction or spy thrillers is everyday reality now: planet-wide earth observation. 

Maybe you’re a civil engineer analysing the extents of past floods in your project area to accurately dimension and position dams and dykes. Or perhaps you’re an ecology grad student trying to figure out the distribution of habitats in your study area. 

Satellite images offer staggering amounts of information for disciplines ranging from biology over archaeology to spatial planning and environmental engineering. 

But accessing these images is often complicated and time-consuming. Their processing is too – and it frequently takes vast amounts of computational resources to get the results you want.

This is where Google Earth Engine comes in. 

What is Google Earth Engine? 

Google Earth Engine (GEE) is a cloud computing platform launched in 2010 by Google. It offers access to a wide variety of remote sensing data, and it provides the possibility of online data analysis. 

Free of charge. Accessible to anyone. 

The significant advantages of Google Earth Engine are its minimal computational requirements and open-access data policy. Once registered on the platform, you can access datasets such as those from Sentinel, Landsat, and MODIS. You can perform analyses straight in your browser – without having to download any software, data or extra packages. 

The aim of GEE is to make remote-sensing analyses as easy as possible. To pave the way for scientists, engineers and anyone else interested in the field. So that they can get reliable results without having to become computer scientists first. 

Here are the basics of how Google Earth Engine works – and six reasons why you should harness its power for your own analyses. 

Why you should use Google Earth Engine

1 – All the data in one place

Google Earth Engine offers an enormous wealth of data, contained in its Data Catalog. The most prominent datasets are image collections from the Sentinel, Landsat and MODIS missions. 

Sentinel is an earth observation mission launched by the European Space Agency back in 2014. A constellation of four satellites provides high-resolution (10 m) images, revisiting every spot on the planet every 5-6 days. Sentinel 1A and 1B offer synthetic aperture radar data, while Sentinel 2A and 2B collect optical information. 

Landsat is NASA’s longest-running Earth observation programme. Launched in 1972, it provides the longest continuous series of satellite images. Landsat images have a resolution of 30 m and a revisit time of about two weeks. 

The MODIS instruments installed on NASA’s Terra and Aqua spacecraft capture the surface of the entire planet every 1-2 days. The tradeoff for this incredible temporal resolution is a spatial resolution of 250-1,000 m.

But GEE also offers a variety of other datasets such as the global SRTM digital elevation model or CHIRPS precipitation data. There are country-specific collections as well – like US data on lithology and agriculture. 

Typically, you’d have to register on a variety of portals like SentinelHub (ESA) or EarthExplorer (NASA) and also chase other data across countless platforms. All that before you can even start your analysis. With Google Earth Engine, you have all these datasets in once place. You can upload your own, too.

Using data in GEE is handy also because it has already been pre-processed. You’d generally have to apply corrections to data from other platforms yourself. These include atmospheric corrections for optical images and radiometric calibration for radar data. 

Basically, the data comes in a ready-to-go package. 

2 – Easy online computation for fast analyses

Working with remote sensing data demands powerful processing, memory and storage.

Earth observation platforms often don’t allow you to select data only for the area you’re interested in. Even if you need only a few square kilometres, you have to download an entire image covering a much larger area. 

Depending on the resolution of the data, this can quickly clog your drives. Especially if you’re working with time series of data. 

I originally started using GEE because my own computer couldn’t handle the 1.5 TB necessary for an analysis in a small part of the Mekong delta over five years. 

In Google Earth Engine, all analyses run on Google’s servers. You enter your commands in the online interface and then run the code. The request is transmitted to the servers, processed there, and the results are returned and visualised. So far, nothing has been saved on your computer. No internal memory has been taken up. 

Once you’re satisfied with your results, you can export them to Google Drive and download them from there. 

3 – Instant access to remote sensing data for offline use 

You don’t fancy running your analyses online, or you can’t stomach the idea of working with code at all? Google Earth Engine might still have something to offer you. 

A fast and painless way of downloading remote sensing data. 

GEE is a data hub. All major earth observation data are available, complemented by many smaller, country-specific datasets. Chances are that something in there is useful for you. 

So you want to stick to ArcGIS or QGIS for your analyses? Google Earth Engine can provide the data you need for your exact study area and a selected time period. 

In as little as 20 lines of code. 

In general, all you have to do is:

Here is an example for exporting an atmosphere-corrected Sentinel 2 image (10 m resolution) for a study area in the Austrian Alps. And you can preview the image online to make sure it is what you want before exporting it. 20 lines of code. Boom.

Or say you’re interested in the mean daily precipitation in your study area. This bit of code averages information from the CHIRPS precipitation dataset over a region of interest and exports it to a CSV file. 40 lines of code. 

The bottom line is: Even if you’re not interested in running your analyses online, pulling your data from GEE is efficient. You need only one login instead of one for every remote sensing portal. And you’ll avoid downloading unnecessary area data. Spare yourself the pain. Use GEE. 

4 – Concise introductions and extensive learning materials

You’ve decided to take the leap and get serious about analyses on Google Earth Engine? Sweet! There are solid learning materials to help you get started. 

The GEE website provides self-paced tutorials on the browser interface and JavaScript, the primary language used for GEE. (A Python API is also available.) 

Video tutorials, each about 1-1.5 hours long, give you the basics on GEE and its most essential functions. These were recorded at actual conferences, and are reasonably easy to follow. They include many practical examples and real-life applications.

The Guides section describes all basic operations, from visualisation to Google Drive export. 

And of course, documentation for every GEE command is available in the Docs tab of the online interface. 

Getting started in Google Earth Engine can seem daunting. Especially if you’ve never worked with code before. But with the extensive materials the website provides, and a bit of determination, you’ll be coding in no time. 

5 – Pre-defined scripts for common operations 

Google Earth Engine offers a vast range of possibilities for running custom analyses. For the most common operations, pre-defined scripts are available. 

You don’t have to reinvent the wheel when you are just starting out with GEE. Want to calculate indices like the NDVI? Create cloud-free composites from Landsat images, or resample data to a lower resolution? GEE has you covered – functions are available. 

The examples provided in the developers’ guide are usually enough to guide you through simple analyses. It is easy to change the names of datasets and areas to those you need. Mixing and matching the code provided will go a long way towards solid results. 

6 – Supportive online community 

Even if you get stuck on a bit of code or have no idea how to go about implementing an analysis in the first place: there are people to help you. 

When I started using Google Earth Engine for my thesis, I was incredibly glad to find that there was a super-supportive user community. 

For one thing, there’s a Google Group that any GEE registered user has access to. People share errors they encounter in their codes, others offer advice. I found that for about 90% of the problems I had in my first weeks, group users had already found solutions. 

And if you start a new thread, responses usually come in within 24 hours. When I ran into a problem I couldn’t solve on my own, I posted my question in the forum. Four hours later, Noel Gorelick (a GEE project engineer) got back to me with a solution. 

But the community of GEE users has spread far beyond the Google group. On GitHub, StackExchange and Reddit, GEE users have long carved out spaces to help anyone – from total novices to seasoned analysts. 

To go further, there are several blogs dedicated to remote sensing and earth observation that feature a variety of posts on GEE. My personal favourite is MyGeoBlog, which offers advice and sample scripts on a massive range of topics. These range from creating a cloud-free composite of Sentinel images, to tracking wildfires in California and the Amazon. 

Where’s the catch? 

But what are the downsides of using Google Earth Engine? It just sounds a little too good to be true. Right? 

Well, there are some issues with GEE.

For one thing, GEE offers a lot of flexibility, but not total freedom. This is especially true for the online JavaScript API. There are always suggestions for the implementation of new algorithms from users. The GEE development team are continuously working on implementing them, true. If an algorithm hasn’t been translated to the GEE framework yet, though, chances are you won’t be able to use it. 

Another issue is that not all data is available for every place or period. There are user complaints that data in some collections are missing for their study areas during specific time intervals. In particular, this is the case for Sentinel 2 surface reflectance data. 

Until recently, no standardised algorithm was available for the atmosphere correction of optical Sentinel images. So, GEE only provided TOA – top of the atmosphere – images. These were not corrected for the presence of aerosols or water vapour in the atmosphere. And thus yielded less precise results. 

Currently, GEE is implementing the sen2cor algorithm to atmosphere-correct Sentinel images. Images from past years are being processed, but they’re still not available everywhere. 

The bottom line

As a tool for remote sensing analyses, Google Earth Engine is not perfect, but enormously useful. 

Whether as a convenient source of pre-processed data or as a platform for running entire analyses with little computational cost, GEE can make working with satellite data a breeze.