I would like to extract mean pixel value of treecover 2000 from Hansen from each geometry (polygon) of different shapefiles that I have import into Google Earth Engine (var table_comp). I create for this reason a for loop.

This is briefly my script:

var gfc =ee.Image('UMD/hansen/global_forest_change_2018_v1_6'); 
var treecover =gfc.select(['treecover2000'])

for (var py=0; py<19; py++){
  //var py=9;
  var year=py+2000

  var table_comp = load feature collection

  var tree_mean_value = treecover.reduceRegions({
    collection: table_comp,
    reducer: ee.Reducer.mean(),

I would like to ask some clarification about the option scale of reduceRegions, in the help I read "A nominal scale in meters of the projection to work in" but I believe to not understand very well. I put 30 because I think this as spatial resolution of my starting image.

Can anybody can help me?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.