1

I, for quite some time now, have been trying to find a way to export the current view of the Google Earth Engine to a TIFF format (or a format that is readable in QGIS, ArcGIS for mapping purposes-JPEG included).

For e.g., let's say that I have 4 Layers in gee (non-overlapping pixels). And, I want to export the whole visualizable overlay of the map in a format. See below: enter image description here This one is a screen shot and can be geo-referenced in QGIS or ArcGIS with some additional work. However, I wanted some code to give the same result.

To give an overview, I want to do something like the code below. However, this code is not working for me.

// Export the image, specifying scale and region.
Export.image.toDrive({
  image: [Layer1, Layer2, Layer3, Layer4],
  description: 'imageToDriveExample',
  scale: 30,
  region: geometry
});

1 Answer 1

1

Without the image or geometry shared, and no error message, it's hard to tell what's going wrong. In any case, image in your export call should be an image, not a list. Assuming that your layers are bands of one single image, try using:

Export.image.toDrive({
  image: image.select(['band1', 'band2', 'band3', 'band4'),
  description: 'description',
  scale: 30,
  region: geometry
});

Alternatively, if the layers are individual images:

imageToExport = ee.ImageCollection.fromImages([image1, image2, image3, image4]).toBands()

Export.image.toDrive({
  image: imageToExport,
  description: 'description',
  scale: 30,
  region: geometry
});

Also, region in the export call defaults to the current view:

region (Geometry.LinearRing|Geometry.Polygon|String, optional) A LinearRing, Polygon, or coordinates representing region to export. These may be specified as the Geometry objects or coordinates serialized as a string. If not specified, the region defaults to the viewport at the time of invocation.

In other words, when specifying region: geometry the exported region is whatever falls within the bounds of that geometry. If you leave it blank, it'll export whatever is currently displayed. However, for reproducibility it's recommendable to specify the region.

2
  • As I said before, all the images (or Layers), in the present case, stem from different images. That is probably the reason the code didn't work. As for the geometry, you can assume any geometry you want.
    – Ep1c1aN
    Commented Mar 16, 2021 at 9:28
  • That wasn't very clear from your initial question. To export multiple images at once, you could for create create a multiband image with ee.ImageCollection.fromImages([image1, image2, image3, image4]).toBands(). I've modified my answer accordingly.
    – hooge048
    Commented Mar 16, 2021 at 13:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.