I previously posted about this same problem as Iterating over years for features in feature collection using Google Earth Engine?

I realized recently that the results that I was getting based on the solution were actually incorrect as I had misread what the variables mean. In fact, it is impossible to get the 'gain' in trees per year so I'm not really sure what the values the code computed were.

Anyhow, I've rewritten the code, and it seems to work in theory, but I am having difficulty with one aspect of it. In particular, I understand that the resolution of the Hansen data is 30 meters per pixel. For this reason, I followed the tutorial for the data and tried to set scale: 30 in my image reduction. However, this causes the console to time out, even though I set maxPixels: 1e9.

When I increase the scale to 100 or greater, it works fine. However, I have been reading about scale here: https://developers.google.com/earth-engine/scale and I still don't have a clear idea what exactly it means for the interpretability of my results. Ideally, I am trying to use the data to be able to talk about square meters of loss in forest, as they do in the tutorial: https://developers.google.com/earth-engine/tutorial_forest_03

Is it okay for me to set scale to higher than scale:30, and what will that mean for interpreting the computation?

1 Answer 1


As described here, use Export to overcome time out errors. If you are using a higher scale, the aggregated data will be resampled as necessary to perform the computation at the specified scale. However, the pyramiding policy of the 'loss' and 'gain' bands is mean, which means that two 0s and two 1s becomes a 1, introducing a slight positive bias. If you can get away with an export instead of reduced scale, that is the recommended approach.

  • Thanks, I actually ended up finding that guide and using the Export strategy. It took about 40 minutes to compile, but it worked. But thanks for explaining the bias issue. Is it true for any kind of data if you change the scale?
    – Sergei
    Apr 3, 2018 at 18:49
  • The aggregation (pyramiding) policy can differ for each image and each band within an image. Generally, use mean for continuous data and mode for nominal data, though it's clear that rule is not universally implemented. Also, mode in this context would introduce a different kind of bias since sample is used to break ties. If the answer helps, please upvote it. Apr 4, 2018 at 16:24
  • 1
    Thanks for this great answer. Can you say a bit about how you found the respective pyramiding policies for the different bands?
    – shrgm
    Apr 12, 2022 at 14:40
  • I second @shreyasgm 's question. It would be useful to understand how you learned that indeed those are the pyramid policies that were used there?
    – Andrei
    Jul 25, 2022 at 16:11
  • 1
    Unfortunately, there's no way to discover what pyramiding policy was used on any given image, as it's not stored in the image metadata. There's an active feature request to save that metadata. In the meantime, you just have to know how the dataset was created. Jul 28, 2022 at 22:40

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.