Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

130
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda