Making a timelapse movie

with a timestamp

step 1: draw a geometry around your area of interest

Step 2: copy the text below and check whether you have sufficient imagery for your aoi

// import text package from Gena
var text = require('users/gena/packages:text');

var l4 = ee.ImageCollection("LANDSAT/LT04/C02/T1_L2");
var l5 = ee.ImageCollection("LANDSAT/LT05/C02/T1_L2");
var l7 = ee.ImageCollection("LANDSAT/LE07/C02/T1_L2");
var l8 = ee.ImageCollection("LANDSAT/LC08/C02/T1_L2");

var l4names = ee.List(["SR_B1","SR_B2","SR_B3"]);
var l5names = ee.List(["SR_B1","SR_B2","SR_B3"]);
var l7names = ee.List(["SR_B1","SR_B2","SR_B3"]);
var l8names = ee.List(["SR_B2","SR_B3","SR_B4"]);

// bands
var outBands = ee.List(['blue','green','red']);

// Filter based on location
var l4images  = l4.filterBounds(geometry).filter("CLOUD_COVER",2));
var l5images  = l5.filterBounds(geometry).filter("CLOUD_COVER",2));
var l7images  = l7.filterBounds(geometry).filter("CLOUD_COVER",2));
var l8images  = l8.filterBounds(geometry).filter("CLOUD_COVER",2));


Step 3: copy and paste the text below.

// Change the bandnames
l4images =,outBands);
l5images =,outBands);
l7images =,outBands);
l8images =,outBands);


// Combine all data in single collection
var myCollection = ee.ImageCollection((l4images.merge(l5images))

var scale = 0.0000275;
var offset = -0.2;

myCollection ={
    return image.add(offset).multiply(scale).set("system:time_start",image.get("system:time_start"));

myCollection = myCollection.sort("system:time_start");

Step 4: copy and paste the code below and hit run to export the movie. This should take around 50 min. You can find the result in your google drive when finished.

// Select the red, green an blue bands
myCollection =['red','green','blue'])

// we need an 8-bit format
var coll4Video = {
     var date = ee.Date(image.get('system:time_start'))
     var label = date.format('YYYY')
    return image.multiply(512).uint8().clip(geometry).set({label: label});;   // need to make it 8-bit

// annotate
var annotations = [
    position: 'left', offset: '1%', margin: '1%', property: 'label', scale: Map.getScale() * 2

coll4Video = {
  return text.annotateImage(image, {}, geometry, annotations)

Map.centerObject(geometry, 9)  

// export the video to the drive{
    collection: coll4Video,
    description: "ppv1" , 
    scale: 30,
    framesPerSecond: 2,
    region: geometry

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s