There are two approaches to calculate the average NDVI, depending on the method you are using to query the data.
If you are using Python, you could access the data in a
numpy array and perform statistical calculations on the array in Python.
An alternative approach would be to use our Statistical API, by creating a layer in your dashboard, and calling it with the API.
In both cases, you will need to change my Evalscript a little bit. Indeed, currently the data returned aren’t the actual physical values but RGB colours associated to values for visualisation purposes.
Rather than return the 3 bands in the evalscript, you would want to return 1 band with either the
ndvi variable or the