1

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!

2

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.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.