0

I'm trying to export an image of a specific region that multiple times that has different parameters. I'm using Sentinel-2 imagery and would like to export true color, false color and SWIR imagery based off a single variable. The code I have looks like this:

//Set map centre
Map.setCenter(159.9737, -9.4336, 12.5)

var roi = ee.Geometry.Polygon(
        [[[159.9024627043289, -9.391377171560114],
          [159.9024627043289, -9.482819760533483],
          [160.03773186936797, -9.482819760533483],
          [160.03773186936797, -9.391377171560114]]], null, false)

//Import Sentinel-2 Imagery
var S2 = ee.ImageCollection('COPERNICUS/S2')
    .filterDate('2017-01-01', '2021-01-01')
    .filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 20))

//clip to region of interest
var median = S2.median();
var clipped = median.clip(roi);

//add different visualisations to map
Map.addLayer(clipped, {bands: ['B4', 'B3', 'B2'], min: 301.55555555555554, max: 2162}, 'True Colour')
Map.addLayer(clipped, {bands: ['B8', 'B4', 'B3'], min: 215.9245283018868, max: 4181.5}, 'False Colour')
Map.addLayer(clipped, {bands: ['B12', 'B8', 'B4'], min: 68.14285714285714, max: 3633}, 'SWIR')

Any suggestions on how I can export the three different types of visualisation?

2
  • Map.addLayer with parameters is a simple representation, is a digital image instead of a raster image. Are you trying to export the map or the source image?
    – aldo_tapia
    Commented May 1, 2022 at 3:22
  • I'm trying to export the representation within the selected region rather than the whole map.
    – Danee
    Commented May 2, 2022 at 1:25

0

Your Answer

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

Browse other questions tagged or ask your own question.