I am trying to export a resampled image from Google Earth Engine, and keep getting errors such as -
Error: Reprojection output too large (23734x8520 pixels).
As shown in the following screenshot -
The error can be reproduced using the sample script from https://developers.google.com/earth-engine/resample#reduce-resolution as follows -
// Load a MODIS EVI image.
var modis = ee.Image(ee.ImageCollection('MODIS/006/MOD13A1').first())
.select('EVI');
// Display the EVI image near La Honda, California.
Map.setCenter(-122.3616, 37.5331, 12);
Map.addLayer(modis, {min: 2000, max: 5000}, 'MODIS EVI');
// Get information about the MODIS projection.
var modisProjection = modis.projection();
print('MODIS projection:', modisProjection);
// Load and display forest cover data at 30 meters resolution.
var forest = ee.Image('UMD/hansen/global_forest_change_2015')
.select('treecover2000');
Map.addLayer(forest, {max: 80}, 'forest cover 30 m');
// Get the forest cover data at MODIS scale and projection.
var forestMean = forest
// Force the next reprojection to aggregate instead of resampling.
.reduceResolution({
reducer: ee.Reducer.mean(),
maxPixels: 1024
})
// Request the data at the scale and projection of the MODIS image.
.reproject({
crs: modisProjection
});
// Display the aggregated, reprojected forest cover data.
Map.addLayer(forestMean, {max: 80}, 'forest cover at MODIS scale');
The script works fine and the resampled image forestMean
is shown on the map.
However, trying to export the image with the following expressions leads to the above-mentioned error -
// Continental USA polygon
var pol = ee.Geometry.Polygon([[[-126.21093749999999,23.241346102386135],[-67.8515625,23.241346102386135],[-67.8515625,48.922499263758255],[-126.21093749999999,48.922499263758255],[-126.21093749999999,23.241346102386135]]]);
// Export
Export.image.toDrive({
image: forestMean,
description: "forest_example",
scale: 926.6254330555,
region: pol
});
It is important to note that the same error appears even when using a very small export region.
Update:
As Philipp Gärtner discovered, this seems to be an issue of export area size. Using a very small area indeed works.