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

138
Visualizações
Get image statistic table on Google Earth Engine

I would like to have a look at my raster statistics, similar to freq(raster) in R, but in Google Earth Engine. I would like to know which pixel value appears how often (it is a classified raster). I can't seem to find the right ee function for this. Can anyone help?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

These kind of statistics may require or NOT a region over which things are be computed depending on whether you are dealing with a bounded or an unbounded image. So, let's have a region of interest first:

var region = 
    /* color: #98ff00 */
    /* displayProperties: [
      {
        "type": "rectangle"
      }
    ] */
    ee.Geometry.Polygon(
        [[[-111.4018515625, 42.568784561631375],
          [-111.4018515625, 35.47803445034791],
          [-91.62646093750003, 35.47803445034791],
          [-91.62646093750003, 42.568784561631375]]], null, false);

Now, we can load a classified image. Let's assume the IGBP classification since you mentioned a classified image and you didn't provide any:

var image = ee.Image('MODIS/051/MCD12Q1/2012_01_01')
  .select('Land_Cover_Type_1');

If you want the frequencies as raw values, you can reduce the classified image as follows:

var freq = image.reduceRegion({
  reducer: ee.Reducer.frequencyHistogram(),
  geometry: region,
  scale: 100
});

print(freq);

If you want a chart, you can use ui.Chart.image.histogram as follows:

var chart  = ui.Chart.image.histogram({
  image: image, 
  region: region, 
  scale: 100
});

print(chart)

Link to code

about 4 years ago · Juan Pablo Isaza Relatório
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