Chapter 24: Image Collection Export

This chapter provides a workflow to export all images in a collection from June 1, 2020 to January 21, 2021 for Rocky Mountain National Park, Colorado, United States. The full GEE code can be found here.

Resources:

Functions

// Import geetools-code-editor Batch module
var batch = require('users/fitoprincipe/geetools:batch');

Data Acquisition & Preprocessing

// Set area of interest (AOI)
var rmnp_boundary = ee.FeatureCollection("users/calekochenour/Rocky_Mountain_National_Park__Boundary_Polygon");

// Filter Landsat 8 based on dates and AOI
var rmnp_collection = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
  .filterDate('2020-06-01', '2021-01-21')
  .filterBounds(rmnp_boundary);
print("Image Collection", rmnp_collection);

Data Processing

// No data processing in this lab.

Data Postprocessing

// No data postprocessing in this lab.

Data Visualization

// No data visualization in this lab.

Data Export

// Set export folder (relative to Google Drive root folder)
var output_folder = 'gee-export';

// Export collection image to Drive
batch.Download.ImageCollection.toDrive(
  rmnp_collection,
  output_folder,
  {
    name: '{id}', // {id}, {system_date} and all other properties (e.g., {WRS_PATH})
    // dateFormat: 'yyyy-MM-dd', // Default
    scale: 30,
    maxPixels: 1e13,
    region: colorado_boundary, // rmnp_boundary,
    type: 'int16' // 'float', 'byte', 'int', 'double', 'long', 'short', 'int8',
                  // 'int16', 'int32', 'int64', 'uint8', 'uint16', 'uint32'
  }
);

print("Completed script. Tasks are available to run.");