Export of reprojected layer from GEE fails Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Iterate over features and years to export images for each feature-yearEarth engine reproject: why does reprojecting a pixel at 30m scale gives me pixels with an area of ~550?Exporting slope raster for entire country in GEEGEE Landsat SR year composite // mask cloud / shadow out w/ other method than quality pixel"export region contains no valid (un-masked) pixels - Google Earth EgineGoogle Earth Engine, how to distinguish between rivers/streams and ponds/lakes in a water maskPython script tool fails when processing rainfall data from Google Earth EngineGoogle Earth Engine Error: Number of pixels requested from Image.load exceeds the maximum allowedCloudfree images in small area from Sentinel-2Using Image exportToDrive in Google Earth Engine?

Do wooden building fires get hotter than 600°C?

What does "lightly crushed" mean for cardamon pods?

How come Sam didn't become Lord of Horn Hill?

Can a party unilaterally change candidates in preparation for a General election?

What's the meaning of "fortified infraction restraint"?

Century handling in Pandas

Is it cost-effective to upgrade an old-ish Giant Escape R3 commuter bike with entry-level branded parts (wheels, drivetrain)?

Where are Serre’s lectures at Collège de France to be found?

If my PI received research grants from a company to be able to pay my postdoc salary, did I have a potential conflict interest too?

Maximum summed powersets with non-adjacent items

What does this Jacques Hadamard quote mean?

Generate an RGB colour grid

Is this homebrew Lady of Pain warlock patron balanced?

Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?

What is the meaning of the simile “quick as silk”?

Why are the trig functions versine, haversine, exsecant, etc, rarely used in modern mathematics?

Denied boarding although I have proper visa and documentation. To whom should I make a complaint?

Is there such thing as an Availability Group failover trigger?

How does the math work when buying airline miles?

How to write this math term? with cases it isn't working

Why aren't air breathing engines used as small first stages?

Is it a good idea to use CNN to classify 1D signal?

An adverb for when you're not exaggerating

Is CEO the profession with the most psychopaths?



Export of reprojected layer from GEE fails



Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Iterate over features and years to export images for each feature-yearEarth engine reproject: why does reprojecting a pixel at 30m scale gives me pixels with an area of ~550?Exporting slope raster for entire country in GEEGEE Landsat SR year composite // mask cloud / shadow out w/ other method than quality pixel"export region contains no valid (un-masked) pixels - Google Earth EgineGoogle Earth Engine, how to distinguish between rivers/streams and ponds/lakes in a water maskPython script tool fails when processing rainfall data from Google Earth EngineGoogle Earth Engine Error: Number of pixels requested from Image.load exceeds the maximum allowedCloudfree images in small area from Sentinel-2Using Image exportToDrive in Google Earth Engine?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















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 -



enter image description here



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.



For example, the following very small export area works -
enter image description here



While this one doesn't work -
enter image description here










share|improve this question



















  • 1





    I tested your code with a very small export region var geometry = ee.Geometry.Polygon( [[[-120.63911377553933, 38.38790575083015], [-120.63911377553933, 37.443193213651234], [-118.98017822866433, 37.443193213651234], [-118.98017822866433, 38.38790575083015]]], null, false); and had no problem exporting the image. Export.image.toDrive( image: forestMean, description: "forest_example", scale: 926.6254330555, region: geometry, maxPixels: 1e13);

    – Philipp Gärtner
    Apr 11 at 11:53











  • Thanks! You're right, I've updated the question to give an example of this.

    – Michael Dorman
    Apr 11 at 12:23

















2















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 -



enter image description here



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.



For example, the following very small export area works -
enter image description here



While this one doesn't work -
enter image description here










share|improve this question



















  • 1





    I tested your code with a very small export region var geometry = ee.Geometry.Polygon( [[[-120.63911377553933, 38.38790575083015], [-120.63911377553933, 37.443193213651234], [-118.98017822866433, 37.443193213651234], [-118.98017822866433, 38.38790575083015]]], null, false); and had no problem exporting the image. Export.image.toDrive( image: forestMean, description: "forest_example", scale: 926.6254330555, region: geometry, maxPixels: 1e13);

    – Philipp Gärtner
    Apr 11 at 11:53











  • Thanks! You're right, I've updated the question to give an example of this.

    – Michael Dorman
    Apr 11 at 12:23













2












2








2








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 -



enter image description here



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.



For example, the following very small export area works -
enter image description here



While this one doesn't work -
enter image description here










share|improve this question
















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 -



enter image description here



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.



For example, the following very small export area works -
enter image description here



While this one doesn't work -
enter image description here







google-earth-engine






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 11 at 12:21







Michael Dorman

















asked Apr 10 at 14:18









Michael DormanMichael Dorman

1328




1328







  • 1





    I tested your code with a very small export region var geometry = ee.Geometry.Polygon( [[[-120.63911377553933, 38.38790575083015], [-120.63911377553933, 37.443193213651234], [-118.98017822866433, 37.443193213651234], [-118.98017822866433, 38.38790575083015]]], null, false); and had no problem exporting the image. Export.image.toDrive( image: forestMean, description: "forest_example", scale: 926.6254330555, region: geometry, maxPixels: 1e13);

    – Philipp Gärtner
    Apr 11 at 11:53











  • Thanks! You're right, I've updated the question to give an example of this.

    – Michael Dorman
    Apr 11 at 12:23












  • 1





    I tested your code with a very small export region var geometry = ee.Geometry.Polygon( [[[-120.63911377553933, 38.38790575083015], [-120.63911377553933, 37.443193213651234], [-118.98017822866433, 37.443193213651234], [-118.98017822866433, 38.38790575083015]]], null, false); and had no problem exporting the image. Export.image.toDrive( image: forestMean, description: "forest_example", scale: 926.6254330555, region: geometry, maxPixels: 1e13);

    – Philipp Gärtner
    Apr 11 at 11:53











  • Thanks! You're right, I've updated the question to give an example of this.

    – Michael Dorman
    Apr 11 at 12:23







1




1





I tested your code with a very small export region var geometry = ee.Geometry.Polygon( [[[-120.63911377553933, 38.38790575083015], [-120.63911377553933, 37.443193213651234], [-118.98017822866433, 37.443193213651234], [-118.98017822866433, 38.38790575083015]]], null, false); and had no problem exporting the image. Export.image.toDrive( image: forestMean, description: "forest_example", scale: 926.6254330555, region: geometry, maxPixels: 1e13);

– Philipp Gärtner
Apr 11 at 11:53





I tested your code with a very small export region var geometry = ee.Geometry.Polygon( [[[-120.63911377553933, 38.38790575083015], [-120.63911377553933, 37.443193213651234], [-118.98017822866433, 37.443193213651234], [-118.98017822866433, 38.38790575083015]]], null, false); and had no problem exporting the image. Export.image.toDrive( image: forestMean, description: "forest_example", scale: 926.6254330555, region: geometry, maxPixels: 1e13);

– Philipp Gärtner
Apr 11 at 11:53













Thanks! You're right, I've updated the question to give an example of this.

– Michael Dorman
Apr 11 at 12:23





Thanks! You're right, I've updated the question to give an example of this.

– Michael Dorman
Apr 11 at 12:23










1 Answer
1






active

oldest

votes


















1














It seems that the problem you are running into is that when Earth Engine is trying to reduce the resolution there are too many pixels going into the aggregation calculation at the scale you are requesting at. A way to circumvent the problem is to set the bestEffort argument to true and lower the maxPixel values in reduceResolution(). Here is a working example:



// 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: 64,
bestEffort:true
)
// 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');

// Continental USA polygon
var pol = ee.Geometry.Rectangle([-125,25,-67,49],'EPSG:4326',false);

Map.addLayer(pol,color:'red','Export Region')

// Export
Export.image.toDrive(
image: forestMean,
description: "forest_example",
scale: 926.6254330555,
region: pol,
maxPixels:1e13
);


I tried the export over the CONUS and it took 8 minutes (resulting image below in QGIS). Be careful of the resulting values though...since you are lowing the number of pixels going into the resolution reduction, the MODIS scale values may not be absolutely accurate.



I hope this helps!



result image






share|improve this answer























  • This clarifies the situation, thanks. However, I need the averages to be based on the entire sample of matching pixels, so this solution is unsuitable for what I need.

    – Michael Dorman
    Apr 14 at 14:58






  • 1





    That is understandable. Another way to do it is to make an export grid with tiles that Earth Engine can export reliable results, export multiple images, and merge them all locally when you are done.

    – Kel Markert
    Apr 14 at 15:01











  • Indeed, in the past an area as large as the CONUS could be exported in tiles. Now that it no longer works, I'm not sure it is worth the effort to split the processing to tiles in the code, then execute all of the Google Drive exports one by one, etc. Perhaps will look for an alternative to GEE.

    – Michael Dorman
    Apr 14 at 15:16











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "79"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f318384%2fexport-of-reprojected-layer-from-gee-fails%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














It seems that the problem you are running into is that when Earth Engine is trying to reduce the resolution there are too many pixels going into the aggregation calculation at the scale you are requesting at. A way to circumvent the problem is to set the bestEffort argument to true and lower the maxPixel values in reduceResolution(). Here is a working example:



// 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: 64,
bestEffort:true
)
// 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');

// Continental USA polygon
var pol = ee.Geometry.Rectangle([-125,25,-67,49],'EPSG:4326',false);

Map.addLayer(pol,color:'red','Export Region')

// Export
Export.image.toDrive(
image: forestMean,
description: "forest_example",
scale: 926.6254330555,
region: pol,
maxPixels:1e13
);


I tried the export over the CONUS and it took 8 minutes (resulting image below in QGIS). Be careful of the resulting values though...since you are lowing the number of pixels going into the resolution reduction, the MODIS scale values may not be absolutely accurate.



I hope this helps!



result image






share|improve this answer























  • This clarifies the situation, thanks. However, I need the averages to be based on the entire sample of matching pixels, so this solution is unsuitable for what I need.

    – Michael Dorman
    Apr 14 at 14:58






  • 1





    That is understandable. Another way to do it is to make an export grid with tiles that Earth Engine can export reliable results, export multiple images, and merge them all locally when you are done.

    – Kel Markert
    Apr 14 at 15:01











  • Indeed, in the past an area as large as the CONUS could be exported in tiles. Now that it no longer works, I'm not sure it is worth the effort to split the processing to tiles in the code, then execute all of the Google Drive exports one by one, etc. Perhaps will look for an alternative to GEE.

    – Michael Dorman
    Apr 14 at 15:16















1














It seems that the problem you are running into is that when Earth Engine is trying to reduce the resolution there are too many pixels going into the aggregation calculation at the scale you are requesting at. A way to circumvent the problem is to set the bestEffort argument to true and lower the maxPixel values in reduceResolution(). Here is a working example:



// 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: 64,
bestEffort:true
)
// 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');

// Continental USA polygon
var pol = ee.Geometry.Rectangle([-125,25,-67,49],'EPSG:4326',false);

Map.addLayer(pol,color:'red','Export Region')

// Export
Export.image.toDrive(
image: forestMean,
description: "forest_example",
scale: 926.6254330555,
region: pol,
maxPixels:1e13
);


I tried the export over the CONUS and it took 8 minutes (resulting image below in QGIS). Be careful of the resulting values though...since you are lowing the number of pixels going into the resolution reduction, the MODIS scale values may not be absolutely accurate.



I hope this helps!



result image






share|improve this answer























  • This clarifies the situation, thanks. However, I need the averages to be based on the entire sample of matching pixels, so this solution is unsuitable for what I need.

    – Michael Dorman
    Apr 14 at 14:58






  • 1





    That is understandable. Another way to do it is to make an export grid with tiles that Earth Engine can export reliable results, export multiple images, and merge them all locally when you are done.

    – Kel Markert
    Apr 14 at 15:01











  • Indeed, in the past an area as large as the CONUS could be exported in tiles. Now that it no longer works, I'm not sure it is worth the effort to split the processing to tiles in the code, then execute all of the Google Drive exports one by one, etc. Perhaps will look for an alternative to GEE.

    – Michael Dorman
    Apr 14 at 15:16













1












1








1







It seems that the problem you are running into is that when Earth Engine is trying to reduce the resolution there are too many pixels going into the aggregation calculation at the scale you are requesting at. A way to circumvent the problem is to set the bestEffort argument to true and lower the maxPixel values in reduceResolution(). Here is a working example:



// 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: 64,
bestEffort:true
)
// 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');

// Continental USA polygon
var pol = ee.Geometry.Rectangle([-125,25,-67,49],'EPSG:4326',false);

Map.addLayer(pol,color:'red','Export Region')

// Export
Export.image.toDrive(
image: forestMean,
description: "forest_example",
scale: 926.6254330555,
region: pol,
maxPixels:1e13
);


I tried the export over the CONUS and it took 8 minutes (resulting image below in QGIS). Be careful of the resulting values though...since you are lowing the number of pixels going into the resolution reduction, the MODIS scale values may not be absolutely accurate.



I hope this helps!



result image






share|improve this answer













It seems that the problem you are running into is that when Earth Engine is trying to reduce the resolution there are too many pixels going into the aggregation calculation at the scale you are requesting at. A way to circumvent the problem is to set the bestEffort argument to true and lower the maxPixel values in reduceResolution(). Here is a working example:



// 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: 64,
bestEffort:true
)
// 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');

// Continental USA polygon
var pol = ee.Geometry.Rectangle([-125,25,-67,49],'EPSG:4326',false);

Map.addLayer(pol,color:'red','Export Region')

// Export
Export.image.toDrive(
image: forestMean,
description: "forest_example",
scale: 926.6254330555,
region: pol,
maxPixels:1e13
);


I tried the export over the CONUS and it took 8 minutes (resulting image below in QGIS). Be careful of the resulting values though...since you are lowing the number of pixels going into the resolution reduction, the MODIS scale values may not be absolutely accurate.



I hope this helps!



result image







share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 14 at 14:27









Kel MarkertKel Markert

1813




1813












  • This clarifies the situation, thanks. However, I need the averages to be based on the entire sample of matching pixels, so this solution is unsuitable for what I need.

    – Michael Dorman
    Apr 14 at 14:58






  • 1





    That is understandable. Another way to do it is to make an export grid with tiles that Earth Engine can export reliable results, export multiple images, and merge them all locally when you are done.

    – Kel Markert
    Apr 14 at 15:01











  • Indeed, in the past an area as large as the CONUS could be exported in tiles. Now that it no longer works, I'm not sure it is worth the effort to split the processing to tiles in the code, then execute all of the Google Drive exports one by one, etc. Perhaps will look for an alternative to GEE.

    – Michael Dorman
    Apr 14 at 15:16

















  • This clarifies the situation, thanks. However, I need the averages to be based on the entire sample of matching pixels, so this solution is unsuitable for what I need.

    – Michael Dorman
    Apr 14 at 14:58






  • 1





    That is understandable. Another way to do it is to make an export grid with tiles that Earth Engine can export reliable results, export multiple images, and merge them all locally when you are done.

    – Kel Markert
    Apr 14 at 15:01











  • Indeed, in the past an area as large as the CONUS could be exported in tiles. Now that it no longer works, I'm not sure it is worth the effort to split the processing to tiles in the code, then execute all of the Google Drive exports one by one, etc. Perhaps will look for an alternative to GEE.

    – Michael Dorman
    Apr 14 at 15:16
















This clarifies the situation, thanks. However, I need the averages to be based on the entire sample of matching pixels, so this solution is unsuitable for what I need.

– Michael Dorman
Apr 14 at 14:58





This clarifies the situation, thanks. However, I need the averages to be based on the entire sample of matching pixels, so this solution is unsuitable for what I need.

– Michael Dorman
Apr 14 at 14:58




1




1





That is understandable. Another way to do it is to make an export grid with tiles that Earth Engine can export reliable results, export multiple images, and merge them all locally when you are done.

– Kel Markert
Apr 14 at 15:01





That is understandable. Another way to do it is to make an export grid with tiles that Earth Engine can export reliable results, export multiple images, and merge them all locally when you are done.

– Kel Markert
Apr 14 at 15:01













Indeed, in the past an area as large as the CONUS could be exported in tiles. Now that it no longer works, I'm not sure it is worth the effort to split the processing to tiles in the code, then execute all of the Google Drive exports one by one, etc. Perhaps will look for an alternative to GEE.

– Michael Dorman
Apr 14 at 15:16





Indeed, in the past an area as large as the CONUS could be exported in tiles. Now that it no longer works, I'm not sure it is worth the effort to split the processing to tiles in the code, then execute all of the Google Drive exports one by one, etc. Perhaps will look for an alternative to GEE.

– Michael Dorman
Apr 14 at 15:16

















draft saved

draft discarded
















































Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid …


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f318384%2fexport-of-reprojected-layer-from-gee-fails%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Magento 1.9 observer on only new product added ( no updated product )Admin Create New Order ObserverObserver checkout_cart_product_add_after get product quantity in cartHow can I differentiate between product creation and saving existing products?How to get the original price Product SaveBeforeMagento Observer for Admin Sales order Address updateHow do i get quantity in a product_save_after event observer magento2?Using observer event to get updated customer infoSave product observer - detect availabilityEvent not triggered when new product added in admin : Magento 2magento 1.9 observer on quantity product change

Does an object always see its latest internal state irrespective of thread? The 2019 Stack Overflow Developer Survey Results Are InDoes a finally block always get executed in Java?Java: serial thread confinement questionJava difference between fixed threadpool and scheduled threadpoolJackrabbit and concurrent modificationHow to stop a Runnable scheduled for repeated execution after a certain number of executionsMultiple threads accessing inner classHow can a loop be completed by two thread? say loop from count=1 to count=4 by ist thread and count =5 to 8 by 2nd thread?If I keep a reference to a Runnable, when does the Thread it ran on get released?How to stop a schedule ScheduledExecutorServiceHow to implement a singleThreadedScheduledExcecutor in wildfly