2

I need to continue working with a mosaic in ArcMap, I wanted to optimize my work so as not to download for monitoring many pictures. I am attaching my code, I tried to make a mosaic, but I can not export.

var collection = ee.ImageCollection('COPERNICUS/S2')
  .filter(ee.Filter.lt("CLOUDY_PIXEL_PERCENTAGE", 10)) 
  .filterDate('2021-08-01' ,'2021-08-30') 
  .filterBounds(polygon) ;
  
  print(collection) ;
  
   //Let's centre the map view over our ROI
Map.centerObject(polygon, 5);
var medianpixels = collection.median(); // This finds the median value of all the pixels which meet the criteria. 
var medianpixelsclipped = medianpixels.clip(polygon).divide(10000);
// Now visualise the mosaic as a natural colour image. 
Map.addLayer(medianpixelsclipped, {bands: ['B4', 'B3', 'B2'], min: 0, max: 1, gamma: 1.5}, 'Sentinel_2 mosaic',false)

2 Answers 2

0

add maxPixels: 1e13
To the export function as given below:

Export.image.toDrive({ image:medianpixelsclipped.select(['B4','B3','B2']), description: 'myMosaic', scale: 10, region: polygon, maxPixels: 1e13, crs: 'EPSG:4326' // or the one you prefer });

2
  • 2
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Apr 27, 2022 at 14:38
  • thanx!!!!!!!))))))))
    – Ayazhan
    Apr 28, 2022 at 5:15
0

You can export your RGB mosaic to Google Drive by using the following code:

Export.image.toDrive({
  image: medianpixelsclipped.select(['B4','B3','B2']),
  description: 'myMosaic',
  scale: 10,
  region: polygon,
  maxPixels: 1e13,
  crs: 'EPSG:4326' // or the one you prefer
});
2
  • it shows error - Error: Export too large: specified 8291273144 pixels (max: 100000000). Specify higher maxPixels value if you intend to export a large area. (Error code: 3)
    – Ayazhan
    Apr 27, 2022 at 11:41
  • Have a look at this gis.stackexchange.com/questions/267523/…
    – HMSP
    Apr 27, 2022 at 11:51

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.