Exporting partial image using Google Earth Engine

Geographic Information Systems Asked on January 6, 2022

When exporting an image to an asset in Google Earth Engine, the task seemingly runs fine but outputs only a tiny corner of my image. It is a filtered, cloud-masked Sentinel-2 scene with 16 bands (13+ image corrections). It does not display any error messages so I assume that GEE thinks it is executing the task I have asked for. One thought I had was that I have used up too much space in my GEE assets folder but this is not the case. I have also tried a drive export and the outcome is the same. The pictures show a) what I was expecting the output to be and b) what it actually was.

Why is this happening and how can I fix it?

This is what I am expecting to get:This is the actual output to my GEE assets

var geometry: polygon, 5 vertices
var collection: ImageCollection "Sentinel-2 MSI: MultiSpectral Instrument, Level-1C"

 //define the cloud mask layer
function maskS2clouds(collection) {
  var qa ='QA60');
  var cloudBitMask = 1 <<10;
  var cirrusBitMask = 1 <<11;
  var mask = qa.bitwiseAnd(cloudBitMask).eq(0)
  return collection.updateMask(mask).divide(10000);

//image collection is filtered
var dataset = ee.ImageCollection("COPERNICUS/S2")
  .filterDate('2015-08-26', '2015-08-28')
//image with mask applied
var image = { return image.clip(geometry); });
Map.addLayer(image, RGB);

//exported to asset
    description: '2015_CLOUDFREE',
    region: geometry,
    scale: 10,
    maxPixels: 1e13

One Answer

var image = { return image.clip(geometry); });
Map.addLayer(image, RGB);

In this code you are displaying the entire image collection (despite its name, image is an ImageCollection) which is implicitly mosaiced by Map.addLayer (all images are combined, taking the most recent available pixel).

//exported to asset

In this code you are taking only the first image of the collection. To get the same result as addLayer, use image: dataset.mosaic(), instead.

Answered by Kevin Reid on January 6, 2022

Add your own answers!

Related Questions

Clipping/ Zooming in on shapefile using R

1  Asked on May 14, 2021 by fbio-nunes


Confused about NoData values

0  Asked on May 13, 2021 by askiofrio


Shapefile To svg to dxf and back to shapefile

0  Asked on May 13, 2021 by yonoson-josef


Convert cityGML to SHP?

0  Asked on May 13, 2021


Merging DEMs in QGIS?

2  Asked on May 13, 2021


What does “Q” (Quantum) stand for in QGIS?

1  Asked on May 13, 2021 by byeong-hyeok-yu


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP