jgrss / geowombat

GeoWombat: Utilities for geospatial data
https://geowombat.readthedocs.io
MIT License
182 stars 10 forks source link

EVI equation is wrong #293

Closed christophfriedrich closed 6 months ago

christophfriedrich commented 8 months ago

I was calculating the EVI with your library and didn't get the results I was expecting, so I had a closer look at the docs and found the equation listed there to be:

image

At first I thought the first times-sign in the denominator was a typo in the docs, but the respective code indeed is:

https://github.com/jgrss/geowombat/blob/6c8b96bb2c3ed772ff9843a95a87a94ae0a35d5d/src/geowombat/core/vi.py#L354-L365

That * on line 360 should be a +.

References: Index Database, USGS, Huete et al 2002

jgrss commented 8 months ago

HI @christophfriedrich, thanks for raising this. See #294 for the fix.

christophfriedrich commented 7 months ago

Thank you for taking care of this so quickly, Friday afternoon to Tuesday morning is quite a nice time from first report to released fix! 👍 I tried it straight away and am now getting the same results as manually in QGIS 👌

Except for areas of very high or low values, as Geowombat clamps the value range to [0,1]. You might want to consider removing this behaviour or at least provide an option to disable it? Unlike NDVI, which is always in [-1,1], values outside [0,1] are absolutely possible and normal for EVI (see e.g. here).

Also, you might want to update the examples in your documentation, e.g. in the Band Math section, as now the scale_factor isn't necessary anymore (it corrected the unintended multiplication of the two four-digit numbers in the denominator which made the result super small).