Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

204
Visualizações
Google Engine: Get pixel sum by feature collection properties

I try to get the sum of my pixel information (carbon content by pixel) and pixel number of an image in my feature collections property BIOTYP8. Output should be carbon content and area of different codes of the property BIOTYP8. Example: 0836 is Birch forest and has total X pixels stored and XXXX total sum of carbon. I tried to rasterize the feature collection, add the bands to the carbon image, but the analysis won't work. Can anyone help or has a better approach?

Map.addLayer(JRC18C,vizParamsC,'JRC18 carbon content');

Map.addLayer(ESA18C,vizParamsC,'ESA18 carbon content');

Map.addLayer(CIRB_f,{},'Forest Biotopes');


var CIRB_fn=CIRB_f.map(function(feature){
    var num = ee.Number.parse(feature.get('BIOTYP8'));
    return feature.set('BIOTYP8', num);
  });
  
function getCols(tableMetadata) {
  print(tableMetadata.columns);
}


///Check on pixel in total covered by Biotopes

var Biot_pixelDic_ESAC = ESA18C.reduceRegion({
  reducer: ee.Reducer.count(),
  geometry: CIRB_f,
  scale: 100,
  maxPixels: 1e9
});

print('Area of ESA forest in CIRB', Biot_pixelDic_ESAC);

var Biot_pixelDic_JRCC = JRC18C.reduceRegion({
  reducer: ee.Reducer.count(),
  geometry: CIRB_f,
  scale: 100,
  maxPixels: 1e9
});
print('Area of JRC forest in CIRB', Biot_pixelDic_JRCC);

//Total stored carbon in biotopes classes
var Biot_sum_ESAC = ESA18C.reduceRegion({
  reducer: ee.Reducer.sum(),
  geometry: CIRB_f,
  scale: 100,
  maxPixels: 1e9
});

print('Sum of ESA forest carbon in CIRB', Biot_sum_ESAC);

var Biot_sum_JRCC = JRC18C.reduceRegion({
  reducer: ee.Reducer.sum(),
  geometry: CIRB_f,
  scale: 100,
  maxPixels: 1e9
});
print('Area of JRC forest carbon in CIRB', Biot_sum_JRCC);

/////////////////// Area by class

//transform vector to image

var CIRB_fi = CIRB_fn.filter(ee.Filter.notNull(['BIOTYP8']))
  .reduceToImage({
    properties: ['BIOTYP8'],
    reducer: ee.Reducer.first(),
});

      
Map.setCenter(13.5145, 52.924, 12);
Map.addLayer(CIRB_fi, {},'CIRB forest image');


//merge image bands

var ESA18C_bioclass= CIRB_fi.addBands(ESA18C);

  
Map.addLayer(ESA18C_bioclass,{},'ESA18C + Biotopes');

var  DIcBiotopes_ESAC = ESA18C_bioclass.reduceRegion({
  reducer: ee.Reducer.sum().group({
  groupField: 1,
    groupName: 'BIOTYP8',
  }),
  geometry: CIRB_f.geometry,
  scale: 100,
  crs:3035,
  maxPixels: 1e9
});


print('Biotypes of ESA forest', Biotopes_ESAC);

Which receives this error for the var DIcBiotopes_ESAC line:

Invalid GeoJSON geometry: undefined 
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda