Extracting NDVI for Landcover Classes in Google Earth Engine

Geographic Information Systems Asked by Ian Dershem on August 8, 2020

I am working on a project where I have created a supervised classification of an image which contains four land cover classes. I have reduced the classification to a frequency histogram that displays the percent land cover taken up by the image, however, I now want to get the NDVI mean for each land cover class.

Using a reducer seems to be the most likely approach but I am not sure how to reduce and match NDVI values associated with each class in this case. The frequency histogram reduction yields the resulting pixel counts:

classification: Object (4 properties)
0: 15330.674509803957
1: 7207.431372549016
2: 71314.45098039194
3: 3969.709803921568

Ideally, I would get an object that looks like this:

classification: Object (4 properties)
0: {pixel_count: 15330.674509803957, NDVI: ...}
1: {pixel_count: 7207.431372549016, NDVI: ...}
2: {pixel_count: 71314.45098039194, NDVI: ...}
3: {pixel_count: 3969.709803921568, NDVI: ...}

Does anyone know what the best way to go about computing this reduction would be?

Thanks for any help!

One Answer

I'm still interested to know if there is a simple reduction method that could do this, however, I did find a workaround.

I used my land cover classification band to create a mask and computed the NDVI for the image for a series of different masks to limit the land cover type for which I was calculating the NDVI value for.

Answered by Ian Dershem on August 8, 2020

Add your own answers!

Related Questions

KML driver failed to create

1  Asked on September 30, 2021


GeoServer Timestamp/Timezone error convert

2  Asked on September 30, 2021 by tim-van-heteren


Optimising a PostGIS table

2  Asked on September 29, 2021


Google Earth Engine – WFS, WMS, and KML feeds

1  Asked on September 29, 2021 by lane


Greyscale image exported

1  Asked on September 29, 2021


ST_AsPNG query has wrong position on Mapbox

0  Asked on September 29, 2021 by kawada


Export central coordinates of current map in print layout

1  Asked on September 29, 2021 by palemon


How to digitize building footprints with orthogonal edges?

3  Asked on September 28, 2021 by shawty


Ask a Question

Get help from others!

© 2022 All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir