Google Earth Engine: Sentinel 5P, and the demise of Fusion Tables

Google Earth Engine seems to be updated pretty frequently. Towards the end of 2018, I noticed two interesting things – that some of the Sentinel 5P data is now available and that Google is shutting down Fusion Tables.

Fusion Tables will be shut down at the start of December 2019, so you have just under a year to migrate any data away. Google seemingly has this habit of shutting down tools.

It is pretty frustrating if you have come to rely upon a particular product. However, it does make you consider open source alternatives. I am not sure at the moment if there is a direct comparative open source alternative to Google Earth Engine, but the Open Data Cube is probably the closest.

https://www.opendatacube.org/

There is a hardware setup cost for this, but it could certainly be managed, the system requirements are here. Is anyone running a small OpenDataCube on a Laptop?

Fusion Tables and GEE…

I wrote about uploading a .kml file to GEE via fusion tables here. Now, about a year later, the best way to load vector GIS data to GEE is… to import a Shapefile. It is well documented here.

Once uploaded you can import it into your GEE project/map by clicking on the arrow associated with it in your Asset tab. It will probably load by default as var table. It is certainly worth re-naming this to something more meaningful. I have uploaded a Shapefile of Greater London. In my case I have changed var table to var London_shp. To view the layer, add these two lines of code:

Map.centerObject(London_shp)
Map.addLayer (London_shp)

These will centre your map on the object London_shp and will add London_shp to the map. If you then print London_shp you will find out that it is a FeatureCollection and has some attributes associated to it.

print (London_shp)

If you need to convert your FeatureCollection to a Geometry object then run:

var london_geo = london_shp.geometry()

print (london_geo)

Some of the calls in Earth Engine require you to parse a Geometry object and not a FeatureCollection. Perhaps if you are new to code but familiar with GIS software this will seem slightly odd. It is worth knowing this, if you don’t get the result you were expecting. One of these cases is the ee.Buffer method (the buffer value is the unit of the coordinate system that will default to metres if not specified). For a 10m buffer, use this code:

var london_buffer = london_geo.buffer(10)

This will be a Geometry object to convert it to a FeatureCollection use this line

var london_shp_out = ee.FeatureCollection(london_buffer)

Now that you have a FeatureCollection you can export to a Shapefile using this code:

// Export the FeatureCollection to a SHP file.
Export.table.toDrive({
  collection: london_shp_out,
  description:'London_10m',
  fileFormat: 'SHP'
});

There you go, the alternative to Fusion Tables.

Sentinel 5P

I am really excited by Sentinel 5P. I’ve blogged about its importance here and how to access it via Python here. Now we can access it in Google Earth Engine, or at least some of the data in GEE. One of the things that is great about GEE is its ability to handle deep time series and we now have a decent amount of data from Sentinel 5P. So, let’s have a look at the mean NO2 covering our London Shapefile that we imported previously.

Map.centerObject(London_shp)
Map.addLayer (London_shp)

Import, change name and centre on the London feature and add it as a layer. Next, add the Sentinel 5P dataset and filter on the NO2 column number density and a date range.

var collection = ee.ImageCollection('COPERNICUS/S5P/NRTI/L3_NO2')
  .select('NO2_column_number_density')
  .filterDate('2018-07-01', '2018-12-31');

Convert the London_shp to a Geometry object as we did earlier:

var london_geo = London_shp.geometry()

Then create the chart:

print(ui.Chart.image.series(collection, london_geo, ee.Reducer.mean(), 30));

Here is the result:

It looks like the data is pretty noisy and variable. I am not an atmospheric scientist, so I don’t know why, but there does seem to be a noticeable decrease in late December. Less traffic around Christmas maybe?

The simplicity

Both these examples make working with data so easy. I’ve previously described working with GEE as like ordering a sandwich. It still seems to be that way.

Average of Great Britain and Northern Island of NO2_column_number_density

I’ve added these files to my useful GEE scripts on GitHub, they are here.

I am a freelancer able to help you with your projects. I offer consultancy, training and writing. I’d be delighted to hear from you.

I have grouped all my previous blogs (technical stuff / tutorials / opinions / ideas) at http://gis.acgeospatial.co.uk.

Feel free to connect or follow me; I am always keen to talk about Earth Observation.

I am @map_andrew on twitter